diff --git a/test/unit/cli/test_ringbuilder.py b/test/unit/cli/test_ringbuilder.py index 955e421ab8..1f2b9494a5 100644 --- a/test/unit/cli/test_ringbuilder.py +++ b/test/unit/cli/test_ringbuilder.py @@ -1925,14 +1925,18 @@ class TestCommands(unittest.TestCase, RunSwiftRingBuilderMixin): mock_stdout = six.StringIO() mock_stderr = six.StringIO() - argv = ["", "object.ring.gz"] + argv = ["", self.tmpfile, "rebalance", "3"], + self.assertSystemExit(EXIT_SUCCESS, ringbuilder.main, argv) + + argv = ["", "%s.ring.gz" % self.tmpfile] with mock.patch("sys.stdout", mock_stdout): with mock.patch("sys.stderr", mock_stderr): self.assertSystemExit(EXIT_ERROR, ringbuilder.main, argv) - expected = "Note: using object.builder instead of object.ring.gz " \ + expected = "Note: using %s.builder instead of %s.ring.gz " \ "as builder file\n" \ - "Ring Builder file does not exist: object.builder\n" + "Ring Builder file does not exist: %s.builder\n" % ( + self.tmpfile, self.tmpfile, self.tmpfile) self.assertEqual(expected, mock_stdout.getvalue()) def test_main_no_arguments(self):