Skip to content

Commit

Permalink
Updated issue with creating files
Browse files Browse the repository at this point in the history
  • Loading branch information
royagrace committed Jul 17, 2024
1 parent 20b6951 commit 3273ec6
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 7 deletions.
12 changes: 6 additions & 6 deletions test/test_checkArgs.py
Original file line number Diff line number Diff line change
Expand Up @@ -78,12 +78,12 @@ def test_checkArgs_outfmt_4(args):
assert argDict.aoi.type()=='radar_rasters'


def test_checkArgs_outfmt_5(args):
'''Test that passing a raster format with height levels throws an error'''
args = args
args.aoi = StationFile(os.path.join(SCENARIO_2, 'stations.csv'))
argDict = checkArgs(args)
assert pd.read_csv(argDict['wetFilenames'][0]).shape == (8, 4)
def test_checkArgs_outfmt_5(args, tmp_path):
with pushd(tmp_path):
args = args
args.aoi = StationFile(os.path.join(SCENARIO_2, 'stations.csv'))
argDict = checkArgs(args)
assert pd.read_csv(argDict['wetFilenames'][0]).shape == (8, 4)


def test_checkArgs_outloc_1(args):
Expand Down
10 changes: 9 additions & 1 deletion test/test_datelist.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,13 @@ def test_datelist():
}

cfg = update_yaml(dct_group, 'temp.yaml')
file_to_del = 'temp.yaml'
param_dict = read_run_config_file(cfg)
assert param_dict['date_list'] == true_dates

if os.path.exists(file_to_del):
os.remove(file_to_del)


def test_datestep():
SCENARIO_DIR = os.path.join(TEST_DIR, 'scenario_5')
Expand All @@ -52,5 +56,9 @@ def test_datestep():
}

cfg = update_yaml(dct_group, 'temp.yaml')
file_to_del = 'temp.yaml'
param_dict = read_run_config_file(cfg)
assert param_dict['date_list'] == true_dates
assert param_dict['date_list'] == true_dates

if os.path.exists(file_to_del):
os.remove(file_to_del)

0 comments on commit 3273ec6

Please sign in to comment.