示例#1
0
    def setup_basic_get_test(self, user, with_local_site, local_site_name,
                             populate_items):
        account = HostingServiceAccount.objects.create(
            service_name='github',
            username='******',
            local_site=self.get_local_site_or_none(name=local_site_name),
            data=json.dumps({
                'authorization': {
                    'token': '123',
                },
            }))

        service = account.service

        remote_repositories = [
            RemoteRepository(service,
                             repository_id='123',
                             name='repo1',
                             owner='bob',
                             scm_type='Git',
                             path='ssh://example.com/repo1',
                             mirror_path='https://example.com/repo1'),
            RemoteRepository(service,
                             repository_id='456',
                             name='repo2',
                             owner='bob',
                             scm_type='Git',
                             path='ssh://example.com/repo2',
                             mirror_path='https://example.com/repo2'),
        ]

        paginator = RemoteRepositoryTestPaginator(remote_repositories)

        self.spy_on(GitHub.get_remote_repositories,
                    call_fake=lambda *args, **kwargs: paginator)

        return (get_remote_repository_list_url(account, local_site_name),
                remote_repository_list_mimetype,
                remote_repositories)
示例#2
0
    def setup_http_not_allowed_list_test(self, user):
        account = HostingServiceAccount.objects.create(service_name='github',
                                                       username='******')

        return get_remote_repository_list_url(account)