Hopefully fix descriptors to compare in test
ci/woodpecker/push/build Pipeline failed Details
ci/woodpecker/push/release Pipeline was successful Details

This commit is contained in:
Olivier 'reivilibre' 2022-11-20 10:02:27 +00:00
parent c1de1341ef
commit fcc79ca95d
1 changed files with 4 additions and 7 deletions

View File

@ -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()