コード例 #1
0
    def setUp(self):
        self.sandbox_path = tempfile.mkdtemp(prefix="jens_sandbox_%s-" %
                                             self._testMethodName,
                                             suffix='-' + str(time.time()))
        init_sandbox(self.sandbox_path)
        self.keep_sandbox = False
        self.debug_level = JensTestCase.DEFAULT_DEBUG_LEVEL
        self.config_file_path = "%s/etc/main.conf" % self.sandbox_path
        config_file = open(self.config_file_path, 'w+')
        config_file.write(
            BASE_CONFIG.substitute(sandbox=self.sandbox_path,
                                   hashprefix=JensTestCase.COMMIT_PREFIX,
                                   debuglevel=self.debug_level,
                                   mandatory_branches=','.join(
                                       JensTestCase.MANDATORY_BRANCHES)))
        config_file.close()

        root = logging.getLogger()
        map(root.removeHandler, root.handlers[:])
        map(root.removeFilter, root.filters[:])

        self.settings = Settings("jens-test")
        self.settings.parse_config(self.config_file_path)

        self.lock = JensLockFactory.makeLock(self.settings)
コード例 #2
0
ファイル: update.py プロジェクト: nbarrientos/jens
    def setUp(self):
        super(UpdateTest, self).setUp()

        ensure_environment(self.settings, 'production', 'master')
        ensure_environment(self.settings, 'qa', 'qa')

        init_repositories(self.settings)
        (bare, user) = create_fake_repository(self.settings, self.sandbox_path, ['qa'])
        add_repository(self.settings, 'common', 'site', bare)
        (bare, user) = create_fake_repository(self.settings, self.sandbox_path, ['qa'])
        add_repository(self.settings, 'common', 'hieradata', bare)

        self.lock = JensLockFactory.makeLock(self.settings)
コード例 #3
0
    def setUp(self):
        super(UpdateTest, self).setUp()

        ensure_environment(self.settings, 'production', 'master')
        ensure_environment(self.settings, 'qa', 'qa')

        init_repositories(self.settings)
        (bare, user) = create_fake_repository(self.settings, self.sandbox_path, ['qa'])
        add_repository(self.settings, 'common', 'site', bare)
        (bare, user) = create_fake_repository(self.settings, self.sandbox_path, ['qa'])
        add_repository(self.settings, 'common', 'hieradata', bare)

        self.lock = JensLockFactory.makeLock(self.settings)
コード例 #4
0
ファイル: testcases.py プロジェクト: nbarrientos/jens
    def setUp(self):
        self.sandbox_path = tempfile.mkdtemp(
            prefix="jens_sandbox_%s-" % self._testMethodName,
            suffix='-' + str(time.time()))
        init_sandbox(self.sandbox_path)
        self.keep_sandbox = False
        self.debug_level = JensTestCase.DEFAULT_DEBUG_LEVEL
        self.config_file_path = "%s/etc/main.conf" % self.sandbox_path
        config_file = open(self.config_file_path, 'w+')
        config_file.write(BASE_CONFIG.substitute(
            sandbox=self.sandbox_path,
            hashprefix=JensTestCase.COMMIT_PREFIX,
            debuglevel=self.debug_level,
            mandatory_branches=','.join(JensTestCase.MANDATORY_BRANCHES)))
        config_file.close()

        root = logging.getLogger()
        map(root.removeHandler, root.handlers[:])
        map(root.removeFilter, root.filters[:])

        self.settings = Settings("jens-test")
        self.settings.parse_config(self.config_file_path)

        self.lock = JensLockFactory.makeLock(self.settings)