From c7b2181ac567afab8ec2d8eb423720925d5f0837 Mon Sep 17 00:00:00 2001 From: Andi Gerken <andi.gerken@gmail.com> Date: Fri, 1 Oct 2021 16:01:42 +0200 Subject: [PATCH] Changed test for evaluation to include more cases. --- tests/robofish/evaluate/test_app_evaluate.py | 28 +++++++++++--------- 1 file changed, 15 insertions(+), 13 deletions(-) diff --git a/tests/robofish/evaluate/test_app_evaluate.py b/tests/robofish/evaluate/test_app_evaluate.py index 43b3e5a..d7b783f 100644 --- a/tests/robofish/evaluate/test_app_evaluate.py +++ b/tests/robofish/evaluate/test_app_evaluate.py @@ -9,23 +9,25 @@ np.seterr(all="raise") logging.getLogger().setLevel(logging.INFO) -h5py_files = [utils.full_path(__file__, "../../resources/valid.hdf5")] -graphics_out = utils.full_path(__file__, "output_graph.png") -if graphics_out.exists(): - graphics_out.unlink() +h5py_file = utils.full_path(__file__, "../../resources/valid.hdf5") -def test_app_validate(): - """ This tests the function of the robofish-io-validate command """ +def test_app_validate(tmp_path): + """This tests the function of the robofish-io-validate command""" class DummyArgs: - def __init__(self, analysis_type): - self.analysis_type = analysis_type - self.paths = h5py_files + def __init__(self, analysis_type, paths, save_path): + self.paths = paths self.names = None - self.save_path = graphics_out + self.analysis_type = analysis_type + self.save_path = save_path for mode in app.function_dict().keys(): - if mode != "all": - app.evaluate(DummyArgs(mode)) - graphics_out.unlink() + if mode == "all": + app.evaluate(DummyArgs(mode, [h5py_file], tmp_path)) + app.evaluate(DummyArgs(mode, [h5py_file, h5py_file], tmp_path)) + else: + app.evaluate(DummyArgs(mode, [h5py_file], tmp_path / "image.png")) + app.evaluate( + DummyArgs(mode, [h5py_file, h5py_file], tmp_path / "image.png") + ) -- GitLab