diff --git a/components/tools/OmeroPy/test/integration/gatewaytest/test_connection.py b/components/tools/OmeroPy/test/integration/gatewaytest/test_connection.py index dd2ecb71ce5..d9550607a6d 100644 --- a/components/tools/OmeroPy/test/integration/gatewaytest/test_connection.py +++ b/components/tools/OmeroPy/test/integration/gatewaytest/test_connection.py @@ -235,7 +235,7 @@ def testConnectUsingClient(self, gatewaywrapper): client = omero.client() client.createSession(user, password) with BlitzGateway(client_obj=client) as conn: - assert client.connect(), "Cannot be connected" + assert conn.connect(), "Should be connected" def testConnectUsingClientNoSessionWithIdentity(self, gatewaywrapper): gatewaywrapper.loginAsAdmin() @@ -250,7 +250,7 @@ def testConnectUsingClientNoSessionWithIdentity(self, gatewaywrapper): client = omero.client() with BlitzGateway(client_obj=client) as conn: conn.setIdentity(user, password) - assert client.connect(), "Cannot be connected" + assert conn.connect(), "Should be connected" def testConnectUsingClientSessionWithoutIdentity(self, gatewaywrapper): gatewaywrapper.loginAsAdmin() @@ -264,7 +264,7 @@ def testConnectUsingClientSessionWithoutIdentity(self, gatewaywrapper): client = omero.client() with BlitzGateway(client_obj=client) as conn: - assert client.connect() == False + assert conn.connect() == False def testSessionId(self, gatewaywrapper): gatewaywrapper.loginAsAdmin() @@ -281,3 +281,20 @@ def testSessionId(self, gatewaywrapper): sid = client.getSessionId() with BlitzGateway(client_obj=client) as conn: assert sid == conn.getSession().getUuid().val + + + def testConnectWithSessionId(self, gatewaywrapper): + gatewaywrapper.loginAsAdmin() + username = "connect_withsession_test_user" + password = "foobar" + connect_test_user = dbhelpers.UserEntry( + username, password, firstname='User', + lastname='connect_withsession') + chmod_test_user.create(gatewaywrapper.gateway, dbhelpers.ROOT.passwd) + gatewaywrapper.doDisconnect() + + client = omero.client() + client.createSession(user, password) + sid = client.getSessionId() + with BlitzGateway(client_obj=client) as conn: + assert conn.connect(sUuid=sid), "Should be connected"