From fcc79ca95d69a52392ad80545d3b6cbbb83c93ae Mon Sep 17 00:00:00 2001 From: Olivier 'reivilibre Date: Sun, 20 Nov 2022 10:02:27 +0000 Subject: [PATCH] Hopefully fix descriptors to compare in test --- testsuite/yamatests/test_compact.py | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/testsuite/yamatests/test_compact.py b/testsuite/yamatests/test_compact.py index 804c685..2703541 100644 --- a/testsuite/yamatests/test_compact.py +++ b/testsuite/yamatests/test_compact.py @@ -77,7 +77,7 @@ class TestYamaCompact(TestCase): seed = rng.randint(0, 9001) print(f"seed: {seed}") rng.seed(seed) - later_expected_descriptor, _ = generate_random_dir(rng, src_path, 32) + initial_descriptor, _ = generate_random_dir(rng, src_path, 32) subprocess.check_call(("datman", "backup-one", "srca", "main"), cwd=datman_path) orig_pointer_name = ( @@ -86,9 +86,8 @@ class TestYamaCompact(TestCase): .split("\n")[0] ) - randomly_mutate_directory_in_descriptor( - later_expected_descriptor, src_path, rng - ) + randomly_mutate_directory_in_descriptor(initial_descriptor, src_path, rng) + mutated_descriptor = scan_dir(src_path) subprocess.check_call(("datman", "backup-one", "srca", "main"), cwd=datman_path) @@ -171,8 +170,6 @@ class TestYamaCompact(TestCase): key, value = next(iter(value.contents.items())) self.assertEqual(key, "srca") - self.assertEqual( - value.ignore_metadata(), later_expected_descriptor.ignore_metadata() - ) + self.assertEqual(value.ignore_metadata(), mutated_descriptor.ignore_metadata()) td.cleanup()