From 02c06585e6e0403d1a983fccaba5093e3d3fa7c5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ond=C5=99ej=20Nov=C3=BD?= Date: Fri, 29 Jan 2016 22:46:50 +0100 Subject: [PATCH] Renamed variable for better code readability Change-Id: I22d8db0dd9edc39672fc9997895a24f669975e15 --- test/unit/cli/test_ringbuilder.py | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/test/unit/cli/test_ringbuilder.py b/test/unit/cli/test_ringbuilder.py index 2cbde67c3f..8856e039f1 100644 --- a/test/unit/cli/test_ringbuilder.py +++ b/test/unit/cli/test_ringbuilder.py @@ -1771,8 +1771,8 @@ class TestCommands(unittest.TestCase, RunSwiftRingBuilderMixin): with mock.patch("sys.stdout", mock_stdout): with mock.patch("sys.stderr", mock_stderr): self.assertRaises(SystemExit, ringbuilder.main, argv) - rnf = re.compile("Ring file .*\.ring\.gz not found") - self.assertTrue(rnf.findall(mock_stdout.getvalue())) + ring_not_found_re = re.compile("Ring file .*\.ring\.gz not found") + self.assertTrue(ring_not_found_re.findall(mock_stdout.getvalue())) # write ring file argv = ["", self.tmpfile, "rebalance"] @@ -1783,8 +1783,8 @@ class TestCommands(unittest.TestCase, RunSwiftRingBuilderMixin): with mock.patch("sys.stdout", mock_stdout): with mock.patch("sys.stderr", mock_stderr): self.assertRaises(SystemExit, ringbuilder.main, argv) - rutd = re.compile("Ring file .*\.ring\.gz is up-to-date") - self.assertTrue(rutd.findall(mock_stdout.getvalue())) + ring_up_to_date_re = re.compile("Ring file .*\.ring\.gz is up-to-date") + self.assertTrue(ring_up_to_date_re.findall(mock_stdout.getvalue())) # change builder (set weight) argv = ["", self.tmpfile, "set_weight", "0", "--id", "3"] @@ -1795,8 +1795,8 @@ class TestCommands(unittest.TestCase, RunSwiftRingBuilderMixin): with mock.patch("sys.stdout", mock_stdout): with mock.patch("sys.stderr", mock_stderr): self.assertRaises(SystemExit, ringbuilder.main, argv) - ro = re.compile("Ring file .*\.ring\.gz is obsolete") - self.assertTrue(ro.findall(mock_stdout.getvalue())) + ring_obsolete_re = re.compile("Ring file .*\.ring\.gz is obsolete") + self.assertTrue(ring_obsolete_re.findall(mock_stdout.getvalue())) # write ring file argv = ["", self.tmpfile, "write_ring"] @@ -1807,7 +1807,7 @@ class TestCommands(unittest.TestCase, RunSwiftRingBuilderMixin): with mock.patch("sys.stdout", mock_stdout): with mock.patch("sys.stderr", mock_stderr): self.assertRaises(SystemExit, ringbuilder.main, argv) - self.assertTrue(rutd.findall(mock_stdout.getvalue())) + self.assertTrue(ring_up_to_date_re.findall(mock_stdout.getvalue())) # Break ring file e.g. just make it empty open('%s.ring.gz' % self.tmpfile, 'w').close() @@ -1817,8 +1817,8 @@ class TestCommands(unittest.TestCase, RunSwiftRingBuilderMixin): with mock.patch("sys.stdout", mock_stdout): with mock.patch("sys.stderr", mock_stderr): self.assertRaises(SystemExit, ringbuilder.main, argv) - ro = re.compile("Ring file .*\.ring\.gz is invalid") - self.assertTrue(ro.findall(mock_stdout.getvalue())) + ring_invalid_re = re.compile("Ring file .*\.ring\.gz is invalid") + self.assertTrue(ring_invalid_re.findall(mock_stdout.getvalue())) def test_rebalance(self): self.create_sample_ring()