def setUp(self): super(AdminTests, self).setUp() c = omero.client(pmap=['--Ice.Config='+(os.environ.get("ICE_CONFIG"))]) try: root_password = c.ic.getProperties().getProperty('omero.rootpass') omero_host = c.ic.getProperties().getProperty('omero.host') finally: c.__del__() from omeroweb.connector import Server server_id = Server.find(server_host=omero_host)[0].id self.login('root', root_password, server_id)
def test_get_and_find(self): Server.reset() SERVER_LIST = [[u'example1.com', 4064, u'omero1'], [u'example2.com', 4064, u'omero2'], [u'example3.com', 4064], [u'example4.com', 4064]] for s in SERVER_LIST: server = (len(s) > 2) and s[2] or None Server(host=s[0], port=s[1], server=server) s1 = Server.get(1) assert s1.host == u'example1.com' assert s1.port == 4064 assert s1.server == u'omero1' s2 = Server.find('example2.com')[0] assert s2.host == u'example2.com' assert s2.port == 4064 assert s2.server == u'omero2'
def test_get_and_find(self): Server.reset() SERVER_LIST = [ ["example1.com", 4064, "omero1"], ["example2.com", 4064, "omero2"], ["example3.com", 4064], ["example4.com", 4064], ] for s in SERVER_LIST: server = (len(s) > 2) and s[2] or None Server(host=s[0], port=s[1], server=server) s1 = Server.get(1) assert s1.host == "example1.com" assert s1.port == 4064 assert s1.server == "omero1" s2 = Server.find("example2.com")[0] assert s2.host == "example2.com" assert s2.port == 4064 assert s2.server == "omero2"