Esempio n. 1
0
 def post_create(self, env):
     print "Enabling RPC plugin and permissions..."
     env.config.set('components', 'tracrpc.*', 'enabled')
     env.config.save()
     self.getLogger = lambda : env.log
     self._tracadmin('permission', 'add', 'anonymous', 'XML_RPC')
     print "Created test environment: %s" % self.dirname
     parts = urllib2.urlparse.urlsplit(self.url)
     # Regular URIs
     self.url_anon = '%s://%s/rpc' % (parts[0], parts[1])
     self.url_auth = '%s://%s/login/rpc' % (parts[0], parts[1])
     # URIs with user:pass as part of URL
     self.url_user = '******' % \
                         (parts[0], parts[1])
     self.url_admin = '%s://admin:admin@%s/login/xmlrpc' % \
                         (parts[0], parts[1])
     SvnFunctionalTestEnvironment.post_create(self, env)
     print "Starting web server: %s" % self.url
     self.restart()
Esempio n. 2
0
 def post_create(self, env):
     print "Enabling RPC plugin and permissions..."
     env.config.set('components', 'tracrpc.*', 'enabled')
     env.config.save()
     self.getLogger = lambda: env.log
     self._tracadmin('permission', 'add', 'anonymous', 'XML_RPC')
     print "Created test environment: %s" % self.dirname
     parts = urllib2.urlparse.urlsplit(self.url)
     # Regular URIs
     self.url_anon = '%s://%s/rpc' % (parts[0], parts[1])
     self.url_auth = '%s://%s/login/rpc' % (parts[0], parts[1])
     # URIs with user:pass as part of URL
     self.url_user = '******' % \
                         (parts[0], parts[1])
     self.url_admin = '%s://admin:admin@%s/login/xmlrpc' % \
                         (parts[0], parts[1])
     SvnFunctionalTestEnvironment.post_create(self, env)
     print "Starting web server: %s" % self.url
     self.restart()
Esempio n. 3
0
 def _tracadmin(self, *args, **kwargs):
     do_wait = kwargs.pop('wait', False)
     SvnFunctionalTestEnvironment._tracadmin(self, *args, **kwargs)
     if do_wait: # Delay to ensure command executes and caches resets
         time.sleep(5)
Esempio n. 4
0
 def init(self):
     self.trac_src = os.path.realpath(os.path.join( 
             __import__('trac', []).__file__, '..' , '..'))
     print "\nFound Trac source: %s" % self.trac_src
     SvnFunctionalTestEnvironment.init(self)
     self.url = "%s:%s" % (self.url, self.port)
Esempio n. 5
0
 def __del__(self):
     print "\nStopping web server...\n"
     self.stop()
     if hasattr(SvnFunctionalTestEnvironment, '__del__'):
         SvnFunctionalTestEnvironment.__del__(self)
Esempio n. 6
0
 def _tracadmin(self, *args, **kwargs):
     do_wait = kwargs.pop('wait', False)
     SvnFunctionalTestEnvironment._tracadmin(self, *args, **kwargs)
     if do_wait:  # Delay to ensure command executes and caches resets
         time.sleep(5)
Esempio n. 7
0
 def init(self):
     self.trac_src = os.path.realpath(
         os.path.join(__import__('trac', []).__file__, '..', '..'))
     print "\nFound Trac source: %s" % self.trac_src
     SvnFunctionalTestEnvironment.init(self)
     self.url = "%s:%s" % (self.url, self.port)