From b1c36dc154061413ecd86d5fb19243a30f107512 Mon Sep 17 00:00:00 2001 From: Kota Tsuyuzaki Date: Mon, 6 Feb 2017 04:08:40 -0800 Subject: [PATCH] Fix test_replicator assertion Because random.randint includeds both endpoints so that random.randint(0, 9) which is assigned in replicatore should be [0-9]. Hence, the assertion for replication_cycle should be *less or equal to* 9. And the replication_cycle should be mod of 10. Change-Id: I81da375a4864256e8f3b473d4399402f83fc6aeb --- test/unit/obj/test_replicator.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/test/unit/obj/test_replicator.py b/test/unit/obj/test_replicator.py index 71d22f5f3f..d3116fb427 100644 --- a/test/unit/obj/test_replicator.py +++ b/test/unit/obj/test_replicator.py @@ -314,10 +314,10 @@ class TestObjectReplicator(unittest.TestCase): (0, '', ['rsync', whole_path_from, rsync_mods])) start = replicator.replication_cycle self.assertGreaterEqual(start, 0) - self.assertLess(start, 9) + self.assertLessEqual(start, 9) with _mock_process(process_arg_checker): replicator.run_once() - self.assertEqual(start + 1, replicator.replication_cycle) + self.assertEqual((start + 1) % 10, replicator.replication_cycle) self.assertFalse(process_errors) self.assertFalse(self.logger.get_lines_for_level('error')) object_replicator.http_connect = was_connector