From: Mukund Sivaraman Date: Tue, 27 Nov 2012 11:02:45 +0000 (+0530) Subject: [master] Fix test for the case where Python readline isn't available X-Git-Tag: bind10-1.0.0-beta-release~46^2~29 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=01ada2f4e0e614d6e5378d277cc1286ed3715ce5;p=thirdparty%2Fkea.git [master] Fix test for the case where Python readline isn't available --- diff --git a/src/bin/bindctl/tests/bindctl_test.py b/src/bin/bindctl/tests/bindctl_test.py index b9af5c2329..5c6aeb2804 100644 --- a/src/bin/bindctl/tests/bindctl_test.py +++ b/src/bin/bindctl/tests/bindctl_test.py @@ -364,16 +364,24 @@ class TestConfigCommands(unittest.TestCase): socket_err_output = io.StringIO() sys.stdout = socket_err_output self.assertEqual(1, self.tool.run()) - self.assertEqual("Failed to send request, the connection is closed\n", - socket_err_output.getvalue()) + + # First few lines may be some kind of heading, or a warning that + # Python readline is unavailable, so we do a sub-string check. + self.assertIn("Failed to send request, the connection is closed", + socket_err_output.getvalue()) + socket_err_output.close() # validate log message for http.client.CannotSendRequest cannot_send_output = io.StringIO() sys.stdout = cannot_send_output self.assertEqual(1, self.tool.run()) - self.assertEqual("Can not send request, the connection is busy\n", - cannot_send_output.getvalue()) + + # First few lines may be some kind of heading, or a warning that + # Python readline is unavailable, so we do a sub-string check. + self.assertIn("Can not send request, the connection is busy", + cannot_send_output.getvalue()) + cannot_send_output.close() def test_apply_cfg_command_int(self):