Merge pull request #2720 from coreos-inc/gc-opt

GC optimizations
This commit is contained in:
josephschorr 2017-06-29 20:55:14 +03:00 committed by GitHub
commit 89ab94ffbb
6 changed files with 695 additions and 639 deletions

View file

@ -8,29 +8,29 @@ from endpoints.api.test.shared import conduct_api_call
from endpoints.test.shared import client_with_identity
from test.fixtures import *
@pytest.mark.parametrize('query, expected_query_count', [
('simple', 7),
('public', 6),
('repository', 6),
@pytest.mark.parametrize('query', [
('simple'),
('public'),
('repository'),
])
def test_repository_search(query, expected_query_count, client):
def test_repository_search(query, client):
with client_with_identity('devtable', client) as cl:
params = {'query': query}
with assert_query_count(expected_query_count):
with assert_query_count(6):
result = conduct_api_call(cl, ConductRepositorySearch, 'GET', params, None, 200).json
assert result['start_index'] == 0
assert result['page'] == 1
assert len(result['results'])
@pytest.mark.parametrize('query, expected_query_count', [
('simple', 8),
('public', 8),
('repository', 8),
@pytest.mark.parametrize('query', [
('simple'),
('public'),
('repository'),
])
def test_search_query_count(query, expected_query_count, client):
def test_search_query_count(query, client):
with client_with_identity('devtable', client) as cl:
params = {'query': query}
with assert_query_count(expected_query_count):
with assert_query_count(8):
result = conduct_api_call(cl, ConductSearch, 'GET', params, None, 200).json
assert len(result['results'])