Skip to content

Commit 8f461de

Browse files
committed
tests: split test_find_arguments between CLI/API
* Try to avoid "too many 429 error responses".
1 parent f4a778c commit 8f461de

File tree

1 file changed

+8
-6
lines changed

1 file changed

+8
-6
lines changed

tests/test_search.py

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -10,20 +10,22 @@
1010

1111
# arguments for testing
1212

13-
test_find_arguments = [
13+
test_api_find_arguments = [
1414
('reactions:"P P--> LQ LQ X"', None, None),
15-
('reactions:"P P --> gamma gamma"', None, None),
1615
('reactions:"P P--> LQ LQ"', 'year', None),
17-
('reactions:"P P--> LQ LQ"', 'arxiv', None),
1816
('reactions:"P P--> LQ LQ"', None, 'arxiv'),
19-
('reactions:"P P--> LQ LQ"', None, 'hepdata'),
2017
('reactions:"P P"', None, 'hepdata'),
2118
]
2219

20+
test_cli_find_arguments = [
21+
('reactions:"P P --> gamma gamma"', None, None),
22+
('reactions:"P P--> LQ LQ"', 'arxiv', None),
23+
('reactions:"P P--> LQ LQ"', None, 'hepdata'),
24+
]
2325

2426
# api test
2527

26-
@pytest.mark.parametrize("query, keyword, ids", test_find_arguments)
28+
@pytest.mark.parametrize("query, keyword, ids", test_api_find_arguments)
2729
def test_api_find(query, keyword, ids):
2830
client = Client(verbose=True)
2931
search_result = client.find(query, keyword, ids)
@@ -37,7 +39,7 @@ def test_api_find(query, keyword, ids):
3739

3840
# cli testing
3941

40-
@pytest.mark.parametrize("query, keyword, ids", test_find_arguments)
42+
@pytest.mark.parametrize("query, keyword, ids", test_cli_find_arguments)
4143
def test_cli_find(query, keyword, ids):
4244
runner = CliRunner()
4345
result = runner.invoke(cli, ['find', query, '-kw', keyword, '-i', ids])

0 commit comments

Comments
 (0)