예제 #1
0
    def test_copy_repo_path_to_tmp_dir(self):
        project = ProjectFactory()
        repo_path = '{}/{}/{}/{}'.format(conf.get('REPOS_MOUNT_PATH'),
                                         project.user.username, project.name,
                                         project.name)
        self.assertFalse(os.path.exists(repo_path))

        repo = RepoFactory(project=project)
        assert repo.path == repo_path
        self.assertTrue(os.path.exists(repo_path))
        git_file_path = '{}/.git'.format(repo_path)
        self.assertTrue(os.path.exists(git_file_path))

        copy_to_tmp_dir(repo_path, 'new')
        git_file_path = '{}/.git'.format(get_tmp_path('new'))
        self.assertTrue(os.path.exists(git_file_path))
예제 #2
0
    def test_copy_repo_path_to_tmp_dir(self):
        project = ProjectFactory()
        repo_path = '{}/{}/{}/{}'.format(settings.REPOS_ROOT,
                                         project.user.username,
                                         project.name,
                                         project.name)
        self.assertFalse(os.path.exists(repo_path))

        repo = RepoFactory(project=project)
        assert repo.path == repo_path
        self.assertTrue(os.path.exists(repo_path))
        git_file_path = '{}/.git'.format(repo_path)
        self.assertTrue(os.path.exists(git_file_path))

        copy_to_tmp_dir(repo_path, 'new')
        git_file_path = '{}/.git'.format(get_tmp_path('new'))
        self.assertTrue(os.path.exists(git_file_path))
예제 #3
0
 def create_tmp_repo(self):
     # Create a tmp copy of the repo before starting the build
     return copy_to_tmp_dir(path=self.repo_path,
                            dir_name=os.path.join(self.uuid, self.image_tag,
                                                  self.folder_name))
예제 #4
0
파일: base.py 프로젝트: ttsvetanov/polyaxon
 def create_tmp_repo(self):
     # Create a tmp copy of the repo before starting the build
     return copy_to_tmp_dir(path=self.repo_path,
                            dir_name=os.path.join(self.uuid, self.image_tag, self.folder_name))