From a05be932c1417d9a7115e11f6317cce4637b5283 Mon Sep 17 00:00:00 2001 From: Marvin Kastner Date: Tue, 26 Sep 2023 21:40:54 +0200 Subject: [PATCH] add test case for random seeds --- .../test_random_seed_store_repository.py | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/conflowgen/tests/application/repositories/test_random_seed_store_repository.py b/conflowgen/tests/application/repositories/test_random_seed_store_repository.py index 5f0e0208..6d8e455f 100644 --- a/conflowgen/tests/application/repositories/test_random_seed_store_repository.py +++ b/conflowgen/tests/application/repositories/test_random_seed_store_repository.py @@ -37,11 +37,21 @@ def test_reuse_existing_entry(self): RandomSeedStore.create( name="reuse_existing", random_seed=seed, - is_random=True + is_random=False ) random_seed = self.repository.get_random_seed("reuse_existing", False) self.assertEqual(random_seed, seed) + def test_do_not_reuse_existing_random_entry(self): + seed = int(time.time()) + RandomSeedStore.create( + name="reuse_existing", + random_seed=seed, + is_random=True + ) + random_seed = self.repository.get_random_seed("reuse_existing", False) + self.assertNotEqual(random_seed, seed) + def test_fix_and_reuse_journey(self): for _ in range(10): seed = int(time.time())