예제 #1
0
class MultiEnvironmentFunctionalTestEnvironment(AgiloFunctionalTestEnvironment):
    """This environment creates actually two environments (one is Agilo-enabled
    while the other is just plain trac) but starts only one tracd which will 
    serve both projects.
    
    This can be used to test that our monkey-patching is not too intrusive."""
    
    # -------------------------------------------------------------------------
    # Overwritten methods
    def __init__(self, config):
        self.super()
        self.use_single_env = False
        self._trac_functional_test_environment = TracFunctionalTestEnvironment(config)
    
    def build_tester(self):
        trac_env = self.get_trac_environment()
        tester = AgiloTester(self.url, self.repo_url, trac_env)
        return tester
    
    def create(self):
        if not self.super():
            return False
        
        # We're in a multi-environment
        base_url = self.url
        self.url = self.url + '/' + os.path.basename(self.envdir)
        
        trac_env = self._trac_functional_test_environment
        assert trac_env.create()
        trac_env.url = base_url + '/' + os.path.basename(trac_env.envdir)
        return True
    
    def _get_process_arguments(self):
        args = self.super()
        trac_env_dir = self._trac_functional_test_environment.envdir
        assert trac_env_dir != None
        args.append(trac_env_dir)
        return args
    
    def start(self):
        if not self.super():
            return False
        trac_env = self._trac_functional_test_environment
        trac_env.tester = trac_env.build_tester()
        trac_env.tester.url = trac_env.url
        return True
    
    def destroy(self):
        self.super()
        self._trac_functional_test_environment.destroy()
    
    def environment_information(self):
        first_env_info = self.super()
        second_env_info = self._trac_functional_test_environment.environment_information()
        return ' -- '.join([first_env_info, second_env_info])
    
    def get_key(cls):
        return 'agilo_multi'
    get_key = classmethod(get_key)
예제 #2
0
 def __init__(self, config):
     self.super()
     self.use_single_env = False
     self._trac_functional_test_environment = TracFunctionalTestEnvironment(
         config)
예제 #3
0
class MultiEnvironmentFunctionalTestEnvironment(AgiloFunctionalTestEnvironment
                                                ):
    """This environment creates actually two environments (one is Agilo-enabled
    while the other is just plain trac) but starts only one tracd which will 
    serve both projects.
    
    This can be used to test that our monkey-patching is not too intrusive."""

    # -------------------------------------------------------------------------
    # Overwritten methods
    def __init__(self, config):
        self.super()
        self.use_single_env = False
        self._trac_functional_test_environment = TracFunctionalTestEnvironment(
            config)

    def build_tester(self):
        trac_env = self.get_trac_environment()
        tester = AgiloTester(self.url, self.repo_url, trac_env)
        return tester

    def create(self):
        if not self.super():
            return False

        # We're in a multi-environment
        base_url = self.url
        self.url = self.url + '/' + os.path.basename(self.envdir)

        trac_env = self._trac_functional_test_environment
        assert trac_env.create()
        trac_env.url = base_url + '/' + os.path.basename(trac_env.envdir)
        return True

    def _get_process_arguments(self):
        args = self.super()
        trac_env_dir = self._trac_functional_test_environment.envdir
        assert trac_env_dir != None
        args.append(trac_env_dir)
        return args

    def start(self):
        if not self.super():
            return False
        trac_env = self._trac_functional_test_environment
        trac_env.tester = trac_env.build_tester()
        trac_env.tester.url = trac_env.url
        return True

    def destroy(self):
        self.super()
        self._trac_functional_test_environment.destroy()

    def environment_information(self):
        first_env_info = self.super()
        second_env_info = self._trac_functional_test_environment.environment_information(
        )
        return ' -- '.join([first_env_info, second_env_info])

    def get_key(cls):
        return 'agilo_multi'

    get_key = classmethod(get_key)
예제 #4
0
 def __init__(self, config):
     self.super()
     self.use_single_env = False
     self._trac_functional_test_environment = TracFunctionalTestEnvironment(config)