From 75b2a6ab8f86a0e500970b44966716d073236625 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20Jan=C3=9Fen?= Date: Mon, 12 Feb 2024 11:23:59 +0100 Subject: [PATCH] Add more tests for job.files.list() --- tests/job/test_genericJob.py | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/tests/job/test_genericJob.py b/tests/job/test_genericJob.py index 5ef2a7339..daa6a3981 100644 --- a/tests/job/test_genericJob.py +++ b/tests/job/test_genericJob.py @@ -463,6 +463,15 @@ def test_restart(self): wd_files = os.listdir(job_restart.working_directory) self.assertEqual(len(wd_files), 1, "Only one zipped file should be present in the working directory") self.assertEqual(wd_files[0], f"{job_restart.name}.tar.bz2", "Inconsistent name for the zipped file") + wd_files = job_restart.files.list() + self.assertEqual( + len(wd_files), + 1, + "Only one input file should be present in the working directory", + ) + self.assertCountEqual( + wd_files, ["input.yml"] + ) job_restart.decompress() wd_files = job_restart.list_files() self.assertEqual( @@ -473,6 +482,15 @@ def test_restart(self): self.assertCountEqual( wd_files, ["input.yml"] ) + wd_files = job_restart.files.list() + self.assertEqual( + len(wd_files), + 1, + "Only one input file should be present in the working directory", + ) + self.assertCountEqual( + wd_files, ["input.yml"] + ) finally: self.project.state.settings.configuration[ wd_warn_key