Пример #1
0
    def test_create_fork(self):
        try:
            fork = self.fork_repo.create_fork(namespace='gitmate-test-user-2')
        except RuntimeError:
            fork = GitLabRepository(self.fork_token, 'gitmate-test-user-2/test')
            fork.delete()
            fork = self.fork_repo.create_fork(namespace='gitmate-test-user-2')

        self.assertIsInstance(fork, GitLabRepository)
Пример #2
0
    def test_create_mr(self):
        try:
            fork = self.fork_repo.create_fork(namespace='gitmate-test-user-2')
        except RuntimeError:
            fork = GitLabRepository(self.fork_token, 'gitmate-test-user-2/test')
            fork.delete()
            fork = self.fork_repo.create_fork(namespace='gitmate-test-user-2')

        fork.create_file(path='.coafile', message='hello', content='hello', branch='master')
        mr = fork.create_merge_request(title='coafile', head='master', base='master',
                                       target_project_id=self.repo.data['id'],
                                       target_project=self.repo.data['path_with_namespace'])

        self.assertIsInstance(mr, GitLabMergeRequest)
Пример #3
0
    def test_create_file(self):
        try:
            fork = self.fork_repo.create_fork(namespace='gitmate-test-user-2')
        except RuntimeError:
            fork = GitLabRepository(self.fork_token, 'gitmate-test-user-2/test')
            fork.delete()
            fork = self.fork_repo.create_fork(namespace='gitmate-test-user-2')
        author = {
            'name': 'gitmate-test-user-2',
            'email': '*****@*****.**'
        }

        self.assertIsInstance(fork.create_file(path='.coafile', message='hello',
                                               content='hello', branch='master', author=author),
                              GitLabContent)