You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@qpid.apache.org by ac...@apache.org on 2016/06/13 19:13:01 UTC

qpid-proton git commit: PROTON-1231: Fixed failing proton_tests..test_allowed_mechs_external

Repository: qpid-proton
Updated Branches:
  refs/heads/master 1f7ccdd55 -> 118a5c3d9


PROTON-1231: Fixed failing proton_tests..test_allowed_mechs_external

The test was comparing exact error message text, changed by previous fix to
include the transport error. Modified to check for a reliable substring.


Project: http://git-wip-us.apache.org/repos/asf/qpid-proton/repo
Commit: http://git-wip-us.apache.org/repos/asf/qpid-proton/commit/118a5c3d
Tree: http://git-wip-us.apache.org/repos/asf/qpid-proton/tree/118a5c3d
Diff: http://git-wip-us.apache.org/repos/asf/qpid-proton/diff/118a5c3d

Branch: refs/heads/master
Commit: 118a5c3d9da962318d2ebcc5401b368046c8c5b2
Parents: 1f7ccdd
Author: Alan Conway <ac...@redhat.com>
Authored: Fri Jun 10 13:53:54 2016 -0400
Committer: Alan Conway <ac...@redhat.com>
Committed: Mon Jun 13 15:07:17 2016 -0400

----------------------------------------------------------------------
 tests/python/proton_tests/utils.py | 13 ++-----------
 1 file changed, 2 insertions(+), 11 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/qpid-proton/blob/118a5c3d/tests/python/proton_tests/utils.py
----------------------------------------------------------------------
diff --git a/tests/python/proton_tests/utils.py b/tests/python/proton_tests/utils.py
index 36b05a6..ca11f21 100644
--- a/tests/python/proton_tests/utils.py
+++ b/tests/python/proton_tests/utils.py
@@ -134,22 +134,15 @@ class SyncRequestResponseTest(Test):
         if "java" in sys.platform:
             raise Skipped("")
         port = free_tcp_port()
-        # We have constructed ConnPropertiesServer with host="127.0.0.1", so it is ok to hardcode the hostname in the error message string.
-        error_message = 'Connection amqp://127.0.0.1:' + str(port) + ' disconnected'
         server = ConnPropertiesServer(Url(host="127.0.0.1", port=port), timeout=self.timeout)
         server.start()
         server.wait()
-        exception_occurred = False
         try:
             # This will cause an exception because we are specifying allowed_mechs as EXTERNAL. The SASL handshake will fail because the server is not setup to handle EXTERNAL
             connection = BlockingConnection(server.url, timeout=self.timeout, properties=CONNECTION_PROPERTIES, offered_capabilities=OFFERED_CAPABILITIES, desired_capabilities=DESIRED_CAPABILITIES, allowed_mechs=EXTERNAL)
+            self.fail("Expected ConnectionException")
         except ConnectionException as e:
-            exc_type, exc_value, exc_traceback = sys.exc_info()
-            self.assertEquals(error_message, str(exc_value))
-            exception_occurred = True
-
-        self.assertEquals(True, exception_occurred)
-
+            self.assertTrue('amqp:unauthorized-access' in str(e), "expected unauthorized-access")
         server.join(timeout=self.timeout)
 
     def test_allowed_mechs_anonymous(self):
@@ -165,6 +158,4 @@ class SyncRequestResponseTest(Test):
         self.assertEquals(server.properties_received, True)
         self.assertEquals(server.offered_capabilities_received, True)
         self.assertEquals(server.desired_capabilities_received, True)
-        
-        
 


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@qpid.apache.org
For additional commands, e-mail: commits-help@qpid.apache.org