Example #1
0
    def setUp(self):
        # Path where to clone remote repo for tests
        self.git_base_repo_path = os.path.join(
            settings.DATA_DIR,
            'test-base-repo.git'
        )
        # Repository on which tests will be performed
        self.git_repo_path = os.path.join(
            settings.DATA_DIR,
            'test-repo.git'
        )

        # Path where to clone remote repo for tests
        self.hg_base_repo_path = os.path.join(
            settings.DATA_DIR,
            'test-base-repo.hg'
        )
        # Repository on which tests will be performed
        self.hg_repo_path = os.path.join(
            settings.DATA_DIR,
            'test-repo.hg'
        )

        # Clone repo for testing
        if not os.path.exists(self.git_base_repo_path):
            GitRepository.clone(
                GIT_URL,
                self.git_base_repo_path,
                bare=True
            )

        # Remove possibly existing directory
        if os.path.exists(self.git_repo_path):
            shutil.rmtree(self.git_repo_path)

        # Create repository copy for the test
        shutil.copytree(self.git_base_repo_path, self.git_repo_path)

        # Clone repo for testing
        if not os.path.exists(self.hg_base_repo_path):
            HgRepository.clone(
                HG_URL,
                self.hg_base_repo_path,
                bare=True
            )

        # Remove possibly existing directory
        if os.path.exists(self.hg_repo_path):
            shutil.rmtree(self.hg_repo_path)

        # Create repository copy for the test
        shutil.copytree(self.hg_base_repo_path, self.hg_repo_path)

        # Remove possibly existing project directory
        test_repo_path = os.path.join(settings.DATA_DIR, 'vcs', 'test')
        if os.path.exists(test_repo_path):
            shutil.rmtree(test_repo_path)
Example #2
0
    def setUp(self):
        # Path where to clone remote repo for tests
        self.git_base_repo_path = os.path.join(settings.DATA_DIR,
                                               'test-base-repo.git')
        # Repository on which tests will be performed
        self.git_repo_path = os.path.join(settings.DATA_DIR, 'test-repo.git')

        # Path where to clone remote repo for tests
        self.hg_base_repo_path = os.path.join(settings.DATA_DIR,
                                              'test-base-repo.hg')
        # Repository on which tests will be performed
        self.hg_repo_path = os.path.join(settings.DATA_DIR, 'test-repo.hg')

        # Clone repo for testing
        if not os.path.exists(self.git_base_repo_path):
            print('Cloning Git test repository to {0}...'.format(
                self.git_base_repo_path))
            GitRepository.clone(GIT_URL, self.git_base_repo_path, bare=True)

        # Remove possibly existing directory
        if os.path.exists(self.git_repo_path):
            shutil.rmtree(self.git_repo_path)

        # Create repository copy for the test
        shutil.copytree(self.git_base_repo_path, self.git_repo_path)

        if HgRepository.is_supported():
            # Clone repo for testing
            if not os.path.exists(self.hg_base_repo_path):
                print('Cloning Mercurial test repository to {0}...'.format(
                    self.hg_base_repo_path))
                HgRepository.clone(HG_URL, self.hg_base_repo_path, bare=True)

            # Remove possibly existing directory
            if os.path.exists(self.hg_repo_path):
                shutil.rmtree(self.hg_repo_path)

            # Create repository copy for the test
            shutil.copytree(self.hg_base_repo_path, self.hg_repo_path)

        # Remove possibly existing project directory
        test_repo_path = os.path.join(settings.DATA_DIR, 'vcs', 'test')
        if os.path.exists(test_repo_path):
            shutil.rmtree(test_repo_path)

        # Remove indexes
        clean_indexes()
Example #3
0
    def setUp(self):
        if 'test-repos' in settings.GIT_ROOT:
            test_dir = os.path.join(settings.GIT_ROOT, 'test')
            if os.path.exists(test_dir):
                shutil.rmtree(test_dir)

        # Path where to clone remote repo for tests
        self.git_base_repo_path = os.path.join(settings.GIT_ROOT,
                                               'test-base-repo.git')
        # Repository on which tests will be performed
        self.git_repo_path = os.path.join(settings.GIT_ROOT, 'test-repo.git')

        # Path where to clone remote repo for tests
        self.hg_base_repo_path = os.path.join(settings.GIT_ROOT,
                                              'test-base-repo.hg')
        # Repository on which tests will be performed
        self.hg_repo_path = os.path.join(settings.GIT_ROOT, 'test-repo.hg')

        # Clone repo for testing
        if not os.path.exists(self.git_base_repo_path):
            GitRepository.clone(GIT_URL, self.git_base_repo_path, bare=True)

        # Remove possibly existing directory
        if os.path.exists(self.git_repo_path):
            shutil.rmtree(self.git_repo_path)

        # Create repository copy for the test
        shutil.copytree(self.git_base_repo_path, self.git_repo_path)

        # Clone repo for testing
        if not os.path.exists(self.hg_base_repo_path):
            HgRepository.clone(HG_URL, self.hg_base_repo_path, bare=True)

        # Remove possibly existing directory
        if os.path.exists(self.hg_repo_path):
            shutil.rmtree(self.hg_repo_path)

        # Create repository copy for the test
        shutil.copytree(self.hg_base_repo_path, self.hg_repo_path)

        # Remove possibly existing project directory
        test_repo_path = os.path.join(settings.GIT_ROOT, 'test')
        if os.path.exists(test_repo_path):
            shutil.rmtree(test_repo_path)
Example #4
0
    def setUp(self):
        # Path where to clone remote repo for tests
        self.git_base_repo_path = os.path.join(settings.DATA_DIR, "test-base-repo.git")
        # Repository on which tests will be performed
        self.git_repo_path = os.path.join(settings.DATA_DIR, "test-repo.git")

        # Path where to clone remote repo for tests
        self.hg_base_repo_path = os.path.join(settings.DATA_DIR, "test-base-repo.hg")
        # Repository on which tests will be performed
        self.hg_repo_path = os.path.join(settings.DATA_DIR, "test-repo.hg")

        # Clone repo for testing
        if not os.path.exists(self.git_base_repo_path):
            print("Cloning Git test repository to {0}...".format(self.git_base_repo_path))
            GitRepository.clone(GIT_URL, self.git_base_repo_path, bare=True)

        # Remove possibly existing directory
        if os.path.exists(self.git_repo_path):
            shutil.rmtree(self.git_repo_path)

        # Create repository copy for the test
        shutil.copytree(self.git_base_repo_path, self.git_repo_path)

        # Clone repo for testing
        if not os.path.exists(self.hg_base_repo_path):
            print("Cloning Mercurial test repository to {0}...".format(self.hg_base_repo_path))
            HgRepository.clone(HG_URL, self.hg_base_repo_path, bare=True)

        # Remove possibly existing directory
        if os.path.exists(self.hg_repo_path):
            shutil.rmtree(self.hg_repo_path)

        # Create repository copy for the test
        shutil.copytree(self.hg_base_repo_path, self.hg_repo_path)

        # Remove possibly existing project directory
        test_repo_path = os.path.join(settings.DATA_DIR, "vcs", "test")
        if os.path.exists(test_repo_path):
            shutil.rmtree(test_repo_path)

        # Remove indexes
        clean_indexes()