diff options
author | Lorenz Diener <[email protected]> | 2019-10-11 23:59:24 +0200 |
---|---|---|
committer | Lorenz Diener <[email protected]> | 2019-10-11 23:59:24 +0200 |
commit | 437f68c29a18303de3c75962021bbe030b2cf85c (patch) | |
tree | 83b7ba151a3e52163fd7048f82672394bcbb3865 /tests/test_search.py | |
parent | 2c2f55fd63e4096580f4d56279c261cedb1be1a9 (diff) | |
download | mastodon.py-437f68c29a18303de3c75962021bbe030b2cf85c.tar.gz |
Update tests for 3.0.1 and fix regressions
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 | ||