Skip to content

Commit ea23c9c

Browse files
committed
Test for new attrs in gen file
1 parent 81b3001 commit ea23c9c

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

tests/test_gen_config.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -94,12 +94,10 @@ def test_gen_from_config(runner, tech, clear_loggers):
9494
# get reV 2.0 generation profiles from disk
9595
rev2_profiles = None
9696
flist = os.listdir(run_dir)
97-
print(flist)
9897
for fname in flist:
9998
if fname.endswith('.h5'):
10099
path = os.path.join(run_dir, fname)
101100
with Outputs(path, 'r') as cf:
102-
103101
msg = 'cf_profile not written to disk'
104102
assert 'cf_profile' in cf.datasets, msg
105103
rev2_profiles = cf['cf_profile']
@@ -115,6 +113,11 @@ def test_gen_from_config(runner, tech, clear_loggers):
115113
else:
116114
assert output not in cf.datasets
117115

116+
assert "run_directory" in cf.h5.attrs
117+
assert "generation_config" in cf.h5.attrs
118+
assert (json.loads(cf.h5.attrs["generation_config"])
119+
== config)
120+
118121
break
119122

120123
if rev2_profiles is None:
@@ -130,9 +133,6 @@ def test_gen_from_config(runner, tech, clear_loggers):
130133
result = np.allclose(rev1_profiles, rev2_profiles,
131134
rtol=RTOL, atol=ATOL)
132135

133-
print(rev1_profiles)
134-
print(rev2_profiles)
135-
136136
clear_loggers()
137137
msg = ('reV generation from config input failed for "{}" module!'
138138
.format(tech))

0 commit comments

Comments
 (0)