def test_search_repos(test_client, repo_fixture: Repository, event_loop): event_loop.run_until_complete(RepositoryFactory.create( owner=repo_fixture.owner, name='test' )) response = test_client.get('/api/repos', params={'name': repo_fixture.name}) data = response.json() assert response.status_code == 200 assert data['data'] == { 'repos': [ repo_data(repo_fixture) ] }
def test_get_all_repos(test_client, event_loop, repo_fixture: Repository): repo1 = event_loop.run_until_complete(RepositoryFactory.create( owner=repo_fixture.owner, name='test' )) response = test_client.get('/api/repos') data = response.json() assert response.status_code == 200 assert data['data'] == { 'repos': [ repo_data(repo_fixture), repo_data(repo1) ] }
def test_get_some_repos_by_owner(test_client, event_loop, repo_fixture: Repository): event_loop.run_until_complete(RepositoryFactory.create( owner=repo_fixture.owner, name='test' )) response = test_client.get( f'/api/repos/owner/{repo_fixture.owner_id}', params={'name': repo_fixture.name} ) data = response.json() assert response.status_code == 200 assert data['data'] == { 'repos': [ repo_data(repo_fixture) ] }