diff options
Diffstat (limited to 'tests/test_search.py')
-rw-r--r-- | tests/test_search.py | 22 |
1 files changed, 18 insertions, 4 deletions
diff --git a/tests/test_search.py b/tests/test_search.py index f05a023..a8ab33a 100644 --- a/tests/test_search.py +++ b/tests/test_search.py | |||
@@ -1,10 +1,8 @@ | |||
1 | import pytest | 1 | import pytest |
2 | import vcr | ||
2 | 3 | ||
3 | @pytest.mark.vcr() | 4 | @pytest.mark.vcr() |
4 | def test_search(api): | 5 | def test_search(api): |
5 | results = api.search_v1('mastodonpy_test') | ||
6 | assert isinstance(results, dict) | ||
7 | |||
8 | results = api.search_v2('mastodonpy_test') | 6 | results = api.search_v2('mastodonpy_test') |
9 | assert isinstance(results, dict) | 7 | assert isinstance(results, dict) |
10 | 8 | ||
@@ -15,3 +13,19 @@ def test_search(api): | |||
15 | assert isinstance(results, dict) | 13 | assert isinstance(results, dict) |
16 | assert len(results["hashtags"]) == 0 | 14 | assert len(results["hashtags"]) == 0 |
17 | assert len(results["accounts"]) == 0 | 15 | assert len(results["accounts"]) == 0 |
16 | |||
17 | def test_search_pre_2_9_2(api): | ||
18 | with vcr.use_cassette('test_search.yaml', cassette_library_dir='tests/cassettes_pre_2_9_2', record_mode='none'): | ||
19 | results = api.search_v1('mastodonpy_test') | ||
20 | assert isinstance(results, dict) | ||
21 | |||
22 | results = api.search_v2('mastodonpy_test') | ||
23 | assert isinstance(results, dict) | ||
24 | |||
25 | results = api.search('mastodonpy_test') | ||
26 | assert isinstance(results, dict) | ||
27 | |||
28 | results = api.search('mastodonpy_test', result_type="statuses") | ||
29 | assert isinstance(results, dict) | ||
30 | assert len(results["hashtags"]) == 0 | ||
31 | assert len(results["accounts"]) == 0 | ||