Skip to content

Commit

Permalink
flake8
Browse files Browse the repository at this point in the history
  • Loading branch information
jburel committed Apr 2, 2024
1 parent 4bdeffc commit 96f5433
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 23 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -502,8 +502,9 @@ def testAuthorCanEdit(self, gatewaywrapper, author_testimg_generated):
ctx = gatewaywrapper.gateway.getAdminService().getEventContext()
uuid = ctx.sessionUuid
gatewaywrapper.loginAsAdmin()
gid = gatewaywrapper.gateway.createGroup("author-can-edit-test-%s" % uuid,
member_Ids=[ctx.userId])
gname = "author-can-edit-test-%s" % uuid
gid = gatewaywrapper.gateway.createGroup(gname,
member_Ids=[ctx.userId])

gatewaywrapper.loginAsUser()
gatewaywrapper.gateway.setGroupForSession(gid)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
from future.utils import native_str
import omero
import Ice
from omero.gateway import BlitzGateway
from omero.gateway.scripts import dbhelpers
import pytest

Expand Down Expand Up @@ -227,9 +228,11 @@ def testConnectUsingClient(self, gatewaywrapper):
gatewaywrapper.loginAsAdmin()
username = "connect_test_user6"
password = "foobar"
connect_test_user = dbhelpers.UserEntry(
username, password, firstname='User', lastname='ConnectUsingClient')
chmod_test_user.create(gatewaywrapper.gateway, dbhelpers.ROOT.passwd)
last_name = "ConnectUsingClient"
test_user= dbhelpers.UserEntry(username, password,
firstname='User',
lastname=last_name)
test_user.create(gatewaywrapper.gateway, dbhelpers.ROOT.passwd)
gatewaywrapper.doDisconnect()

client = omero.client()
Expand All @@ -241,10 +244,11 @@ def testConnectUsingClientNoSessionWithIdentity(self, gatewaywrapper):
gatewaywrapper.loginAsAdmin()
username = "connect_test_user7"
password = "foobar"
connect_test_user = dbhelpers.UserEntry(
username, password, firstname='User',
lastname='ConnectUsingClientNoSessionWithIdentity')
chmod_test_user.create(gatewaywrapper.gateway, dbhelpers.ROOT.passwd)
last_name = "ConnectUsingClientNoSessionWithIdentity"
test_user = dbhelpers.UserEntry(username, password,
firstname='User',
lastname=last_name)
test_user.create(gatewaywrapper.gateway, dbhelpers.ROOT.passwd)
gatewaywrapper.doDisconnect()

client = omero.client()
Expand All @@ -256,24 +260,26 @@ def testConnectUsingClientSessionWithoutIdentity(self, gatewaywrapper):
gatewaywrapper.loginAsAdmin()
username = "connect_test_user8"
password = "foobar"
connect_test_user = dbhelpers.UserEntry(
username, password, firstname='User',
lastname='ConnectUsingClientNoSessionWithoutIdentity')
chmod_test_user.create(gatewaywrapper.gateway, dbhelpers.ROOT.passwd)
last_name = "ConnectUsingClientSessionWithoutIdentity"
test_user = dbhelpers.UserEntry(username, password,
firstname='User',
lastname=last_name)
test_user.create(gatewaywrapper.gateway, dbhelpers.ROOT.passwd)
gatewaywrapper.doDisconnect()

client = omero.client()
with BlitzGateway(client_obj=client) as conn:
assert conn.connect() == False
assert not conn.connect()

def testSessionId(self, gatewaywrapper):
gatewaywrapper.loginAsAdmin()
username = "session_test_user"
password = "foobar"
connect_test_user = dbhelpers.UserEntry(
username, password, firstname='User',
lastname='sessionId')
chmod_test_user.create(gatewaywrapper.gateway, dbhelpers.ROOT.passwd)
last_name = "SessionId"
test_user = dbhelpers.UserEntry(username, password,
firstname='User',
lastname=last_name)
test_user.create(gatewaywrapper.gateway, dbhelpers.ROOT.passwd)
gatewaywrapper.doDisconnect()

client = omero.client()
Expand All @@ -282,15 +288,15 @@ def testSessionId(self, gatewaywrapper):
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)
last_name = "connect_withsessionId"
test_user = dbhelpers.UserEntry(username, password,
firstname='User',
lastname=last_name)
test_user.create(gatewaywrapper.gateway, dbhelpers.ROOT.passwd)
gatewaywrapper.doDisconnect()

client = omero.client()
Expand Down

0 comments on commit 96f5433

Please sign in to comment.