From fabbccbeacad8ccf7d3586db87e0316ccaedd589 Mon Sep 17 00:00:00 2001 From: Dmitri Bogomolov <4glitch@gmail.com> Date: Mon, 29 Oct 2018 18:18:35 +0200 Subject: [PATCH] Rewrote test_user_password() for xmlrpclib.ProtocolError: it would be very difficult to return string from BMXMLRPCRequestHandler --- src/tests/test_api.py | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/src/tests/test_api.py b/src/tests/test_api.py index 44505ffe..0c0cad95 100644 --- a/src/tests/test_api.py +++ b/src/tests/test_api.py @@ -53,11 +53,8 @@ class TestAPI(TestAPIProto): def test_user_password(self): """Trying to connect with wrong username/password""" api_wrong = xmlrpclib.ServerProxy("http://test:wrong@127.0.0.1:8442/") - self.assertEqual( - api_wrong.clientStatus(), - 'RPC Username or password incorrect or HTTP header lacks' - ' authentication at all.' - ) + with self.assertRaises(xmlrpclib.ProtocolError): + api_wrong.clientStatus() def test_connection(self): """API command 'helloWorld'"""