From a1569a33cec28b2ea874ae02fcf5863454586b30 Mon Sep 17 00:00:00 2001 From: Paul Oliver Date: Tue, 7 Jul 2026 23:30:52 +0200 Subject: data-tests (WIP) --- test/test_general.py | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) (limited to 'test/test_general.py') diff --git a/test/test_general.py b/test/test_general.py index 43f3635..edd7328 100644 --- a/test/test_general.py +++ b/test/test_general.py @@ -11,7 +11,7 @@ class SalisTest(unittest.TestCase): def tearDown(self): self.tempdir.cleanup() - def file_list_new(self, name): + def files_on_new(self, name): return [ os.path.join(self.tempdir.name, name, name), os.path.join(self.tempdir.name, name, f"{name}.sqlite3"), @@ -20,6 +20,9 @@ class SalisTest(unittest.TestCase): os.path.join(self.tempdir.name, name, "evas", f"evas-{0:016x}"), ] + def assert_equal(self, v1, v2): + assert v1 == v2, f"{v1} != {v2}" + def assert_file_list_exists(self, files): for file in files: assert os.path.isfile(file), f"{file} does not exist" @@ -33,12 +36,12 @@ class SalisTest(unittest.TestCase): return subprocess.Popen(cmd.split(), stdout=subprocess.PIPE, text=True) @staticmethod - def run_ui_test(anc, anc_path, ui, ui_path, vm_arch, clones=1, cores=1, name="def.sim"): + def run_ui_test(anc, anc_path, ui, ui_path, vm_arch, clones=1, cores=1, mvec_pow=20, name="def.sim", data_push_pow=28, sync_pow=20, **kwargs): def test_decorator(test_case): 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}" + cmd = f"./salis.py new -a{anc} -A{anc_path} -C{clones} -c{cores} -d{data_push_pow} -H{self.tempdir.name} -m{mvec_pow} -n{name} -u{ui} -U{ui_path} -v{vm_arch} -y{sync_pow}" subprocess.run(cmd.split(), check=True, stdout=subprocess.DEVNULL) - self.assert_file_list_exists(self.file_list_new(name)) + self.assert_file_list_exists(self.files_on_new(name)) test_case(self) return test_wrapper -- cgit v1.3.1