Skip to content

Commit

Permalink
TST: Test loading raw clears other prep
Browse files Browse the repository at this point in the history
  • Loading branch information
scottclowe committed Jul 15, 2021
1 parent 623d0eb commit d00fa02
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions fissa/tests/test_core.py
Original file line number Diff line number Diff line change
Expand Up @@ -980,6 +980,21 @@ def test_load_empty_sep(self):
exp.separate()
self.compare_output(exp)

def test_load_clear(self):
"""Test behaviour when loading a cache containing a dynamic property."""
kwargs = {"expansion": 0.213, "nRegions": 3}
fields = {"raw": np.ones((len(self.roi_paths), len(self.image_names)))}
exp = core.Experiment(self.images_dir, self.roi_zip_path, **kwargs)
exp.means = 31802 # Assign means to be a random value
# Make a save file
fname = os.path.join(self.output_dir, "dummy.npz")
os.makedirs(self.output_dir)
np.savez_compressed(fname, **merge_dicts(kwargs, fields))
# Load the file
exp.load(fname)
# Check means was wiped
self.assertIs(exp.means, None)

def test_load_dynamic(self):
"""Test behaviour when loading a cache containing a dynamic property."""
kwargs = {"expansion": 0.213, "nRegions": 3}
Expand Down

0 comments on commit d00fa02

Please sign in to comment.