Trees | Indices | Help |
|
---|
|
1 #!/usr/bin/env python 2 # 3 # 4 # Copyright (c) 2008 University of Dundee. 5 # 6 # This program is free software: you can redistribute it and/or modify 7 # it under the terms of the GNU Affero General Public License as 8 # published by the Free Software Foundation, either version 3 of the 9 # License, or (at your option) any later version. 10 # 11 # This program is distributed in the hope that it will be useful, 12 # but WITHOUT ANY WARRANTY; without even the implied warranty of 13 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 # GNU Affero General Public License for more details. 15 # 16 # You should have received a copy of the GNU Affero General Public License 17 # along with this program. If not, see <http://www.gnu.org/licenses/>. 18 # 19 20 import os 21 import unittest 22 import exceptions 23 24 import omero 25 26 from django.conf import settings 27 from request_factory import Client 28 29 from omeroweb.webgateway import views as webgateway_views 303265 7734 c = omero.client(pmap=['--Ice.Config='+(os.environ.get("ICE_CONFIG"))]) 35 try: 36 self.root_password = c.ic.getProperties().getProperty('omero.rootpass') 37 omero_host = c.ic.getProperties().getProperty('omero.host') 38 finally: 39 c.__del__() 40 41 blitz = settings.SERVER_LIST.find(server_host=omero_host) 42 if blitz is not None: 43 self.server_id = blitz.id 44 self.rootconn = webgateway_views._createConnection('', host=blitz.host, port=blitz.port, username='root', passwd=self.root_password, secure=True, useragent="TEST.webadmin") 45 if self.rootconn is None or not self.rootconn.isConnected() or not self.rootconn.keepAlive(): 46 raise exceptions.Exception("Cannot connect") 47 else: 48 raise exceptions.Exception("'%s' is not on omero.web.server_list")49 5557 blitz = settings.SERVER_LIST.get(pk=self.server_id) 58 if blitz is not None: 59 conn = webgateway_views._createConnection('', host=blitz.host, port=blitz.port, username=username, passwd=password, secure=True, useragent="TEST.webadmin") 60 if conn is None or not conn.isConnected() or not conn.keepAlive(): 61 raise exceptions.Exception("Cannot connect") 62 return conn 63 else: 64 raise exceptions.Exception("'%s' is not on omero.web.server_list")
Trees | Indices | Help |
|
---|
Generated by Epydoc 3.0.1 on Tue Oct 18 13:29:12 2011 | http://epydoc.sourceforge.net |