File tree Expand file tree Collapse file tree 1 file changed +17
-8
lines changed Expand file tree Collapse file tree 1 file changed +17
-8
lines changed Original file line number Diff line number Diff line change 11#!/usr/local/env python
2- """
3- vic2netcdf_unit_test.py
4-
5- Set to run with pytest
2+ """Set to run with pytest
63
7- Usage: py.test (from RVIC or test directory)
4+ Usage: py.test
85"""
6+ import pytest
7+
98import numpy as np
109from tonic .tonic import calc_grid
1110
1211
13- def test_calc_grid_standard ():
14- lons = np .arange (0 , 5 , 0.25 )
15- lats = np .arange (0 , 10 , 0.5 )
12+ @pytest .fixture (scope = "function" )
13+ def lons ():
14+ return np .arange (0 , 5 , 0.25 )
15+
16+
17+ @pytest .fixture (scope = "function" )
18+ def lats ():
19+ return np .arange (0 , 10 , 0.5 )
20+
21+
22+ def test_calc_grid_standard (lons , lats ):
23+ shape = np .meshgrid (lons ,lats )[0 ].shape
1624 target_grid = calc_grid (lons , lats , decimals = 4 )
1725 assert type (target_grid ) == dict
26+ assert target_grid ['mask' ].shape == shape
You can’t perform that action at this time.
0 commit comments