diff options
| author | Paul Oliver <contact@pauloliver.dev> | 2026-07-07 05:57:49 +0200 |
|---|---|---|
| committer | Paul Oliver <contact@pauloliver.dev> | 2026-07-07 05:57:49 +0200 |
| commit | 55928b51596de4cd1b7a2783529ecda3ff3087ce (patch) | |
| tree | d00172e0e7dc1d5bb593c55e5d51acb1634a4855 /test/test_general.py | |
| parent | b54b9ceb2952ba84b58e75aba014558b17d08e77 (diff) | |
Adds run tests and file checks
Diffstat (limited to 'test/test_general.py')
| -rw-r--r-- | test/test_general.py | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/test/test_general.py b/test/test_general.py index eb3185d..43f3635 100644 --- a/test/test_general.py +++ b/test/test_general.py @@ -1,3 +1,4 @@ +import os import subprocess import unittest @@ -10,6 +11,19 @@ class SalisTest(unittest.TestCase): def tearDown(self): self.tempdir.cleanup() + def file_list_new(self, name): + return [ + os.path.join(self.tempdir.name, name, name), + os.path.join(self.tempdir.name, name, f"{name}.sqlite3"), + os.path.join(self.tempdir.name, name, f"{name}-{0:016x}"), + os.path.join(self.tempdir.name, name, "opts.json"), + os.path.join(self.tempdir.name, name, "evas", f"evas-{0:016x}"), + ] + + def assert_file_list_exists(self, files): + for file in files: + assert os.path.isfile(file), f"{file} does not exist" + @staticmethod def run_subprocess(cmd): subprocess.run(cmd.split(), check=True, stdout=subprocess.DEVNULL) @@ -24,6 +38,7 @@ class SalisTest(unittest.TestCase): def test_wrapper(self): cmd = f"./salis.py new -a{anc} -A{anc_path} -C{clones} -c{cores} -H{self.tempdir.name} -n{name} -u{ui} -U{ui_path} -v{vm_arch}" subprocess.run(cmd.split(), check=True, stdout=subprocess.DEVNULL) + self.assert_file_list_exists(self.file_list_new(name)) test_case(self) return test_wrapper |
