diff options
Diffstat (limited to 'tests')
-rw-r--r-- | tests/test_bookmarks.py | 4 | ||||
-rw-r--r-- | tests/test_constructor.py | 6 | ||||
-rw-r--r-- | tests/test_filters.py | 14 | ||||
-rw-r--r-- | tests/test_instance.py | 2 | ||||
-rw-r--r-- | tests/test_media.py | 2 | ||||
-rw-r--r-- | tests/test_push.py | 16 | ||||
-rw-r--r-- | tests/test_streaming.py | 8 | ||||
-rw-r--r-- | tests/test_timeline.py | 4 |
8 files changed, 28 insertions, 28 deletions
diff --git a/tests/test_bookmarks.py b/tests/test_bookmarks.py index 2e1261b..54134e9 100644 --- a/tests/test_bookmarks.py +++ b/tests/test_bookmarks.py | |||
@@ -4,7 +4,7 @@ import pytest | |||
4 | def test_bookmarks(api, status): | 4 | def test_bookmarks(api, status): |
5 | status_bookmarked = api.status_bookmark(status) | 5 | status_bookmarked = api.status_bookmark(status) |
6 | assert status_bookmarked | 6 | assert status_bookmarked |
7 | assert status_bookmarked.bookmarked == True | 7 | assert status_bookmarked.bookmarked |
8 | 8 | ||
9 | bookmarked_statuses = api.bookmarks() | 9 | bookmarked_statuses = api.bookmarks() |
10 | assert bookmarked_statuses | 10 | assert bookmarked_statuses |
@@ -18,7 +18,7 @@ def test_bookmarks(api, status): | |||
18 | 18 | ||
19 | status_unbookmarked = api.status_unbookmark(status_bookmarked) | 19 | status_unbookmarked = api.status_unbookmark(status_bookmarked) |
20 | assert status_unbookmarked | 20 | assert status_unbookmarked |
21 | assert status_unbookmarked.bookmarked == False | 21 | assert not status_unbookmarked.bookmarked |
22 | 22 | ||
23 | bookmarked_statuses_2 = api.bookmarks() | 23 | bookmarked_statuses_2 = api.bookmarks() |
24 | assert bookmarked_statuses_2 is not None | 24 | assert bookmarked_statuses_2 is not None |
diff --git a/tests/test_constructor.py b/tests/test_constructor.py index ebc9b85..d997a5d 100644 --- a/tests/test_constructor.py +++ b/tests/test_constructor.py | |||
@@ -33,9 +33,9 @@ def test_constructor_missing_client_secret(): | |||
33 | 33 | ||
34 | @pytest.mark.vcr() | 34 | @pytest.mark.vcr() |
35 | def test_verify_version(api): | 35 | def test_verify_version(api): |
36 | assert api.verify_minimum_version("2.3.3") == True | 36 | assert api.verify_minimum_version("2.3.3") is True |
37 | assert api.verify_minimum_version("9999.9999.9999") == False | 37 | assert api.verify_minimum_version("9999.9999.9999") is False |
38 | assert api.verify_minimum_version("1.0.0") == True | 38 | assert api.verify_minimum_version("1.0.0") is True |
39 | 39 | ||
40 | def test_supported_version(api): | 40 | def test_supported_version(api): |
41 | assert Mastodon.get_supported_version() \ No newline at end of file | 41 | assert Mastodon.get_supported_version() \ No newline at end of file |
diff --git a/tests/test_filters.py b/tests/test_filters.py index 3ffa726..d3dab8d 100644 --- a/tests/test_filters.py +++ b/tests/test_filters.py | |||
@@ -7,12 +7,12 @@ def test_filter_create(api): | |||
7 | with vcr.use_cassette('test_filter_create.yaml', cassette_library_dir='tests/cassettes_pre_4_0_0', record_mode='none'): | 7 | with vcr.use_cassette('test_filter_create.yaml', cassette_library_dir='tests/cassettes_pre_4_0_0', record_mode='none'): |
8 | keyword_filter = api.filter_create("anime", ['notifications'], irreversible = False, whole_word = True, expires_in = None) | 8 | keyword_filter = api.filter_create("anime", ['notifications'], irreversible = False, whole_word = True, expires_in = None) |
9 | try: | 9 | try: |
10 | assert(keyword_filter) | 10 | assert keyword_filter |
11 | 11 | ||
12 | all_filters = api.filters() | 12 | all_filters = api.filters() |
13 | assert(keyword_filter in all_filters) | 13 | assert keyword_filter in all_filters |
14 | assert(keyword_filter.irreversible == False) | 14 | assert keyword_filter.irreversible is False |
15 | assert(keyword_filter.whole_word == True) | 15 | assert keyword_filter.whole_word is True |
16 | 16 | ||
17 | keyword_filter_2 = api.filter(keyword_filter.id) | 17 | keyword_filter_2 = api.filter(keyword_filter.id) |
18 | assert(keyword_filter == keyword_filter_2) | 18 | assert(keyword_filter == keyword_filter_2) |
@@ -22,9 +22,9 @@ def test_filter_create(api): | |||
22 | 22 | ||
23 | keyword_filter = api.filter_create("anime", ['notifications'], irreversible = False, whole_word = False, expires_in = None) | 23 | keyword_filter = api.filter_create("anime", ['notifications'], irreversible = False, whole_word = False, expires_in = None) |
24 | try: | 24 | try: |
25 | assert(keyword_filter) | 25 | assert keyword_filter |
26 | assert(keyword_filter.irreversible == False) | 26 | assert keyword_filter.irreversible is False |
27 | assert(keyword_filter.whole_word == False) | 27 | assert keyword_filter.whole_word is False |
28 | 28 | ||
29 | all_filters = api.filters() | 29 | all_filters = api.filters() |
30 | assert(keyword_filter in all_filters) | 30 | assert(keyword_filter in all_filters) |
diff --git a/tests/test_instance.py b/tests/test_instance.py index 8f3f142..1fbd692 100644 --- a/tests/test_instance.py +++ b/tests/test_instance.py | |||
@@ -38,7 +38,7 @@ def test_emoji(api): | |||
38 | 38 | ||
39 | @pytest.mark.vcr() | 39 | @pytest.mark.vcr() |
40 | def test_health(api): | 40 | def test_health(api): |
41 | assert api.instance_health() == True | 41 | assert api.instance_health() is True |
42 | 42 | ||
43 | @pytest.mark.vcr() | 43 | @pytest.mark.vcr() |
44 | def test_server_time(api): | 44 | def test_server_time(api): |
diff --git a/tests/test_media.py b/tests/test_media.py index 9668f59..e16fb4d 100644 --- a/tests/test_media.py +++ b/tests/test_media.py | |||
@@ -21,7 +21,7 @@ def test_media_post_v1(api): | |||
21 | assert status | 21 | assert status |
22 | 22 | ||
23 | try: | 23 | try: |
24 | assert status['sensitive'] == False | 24 | assert status['sensitive'] is False |
25 | assert status['media_attachments'] | 25 | assert status['media_attachments'] |
26 | assert status['media_attachments'][0]['description'] == "John Lennon doing a funny walk" | 26 | assert status['media_attachments'][0]['description'] == "John Lennon doing a funny walk" |
27 | assert status['media_attachments'][0]['meta']['focus']['x'] == -0.5 | 27 | assert status['media_attachments'][0]['meta']['focus']['x'] == -0.5 |
diff --git a/tests/test_push.py b/tests/test_push.py index daa99c7..b815910 100644 --- a/tests/test_push.py +++ b/tests/test_push.py | |||
@@ -57,14 +57,14 @@ def test_push_update(api): | |||
57 | print(sub3) | 57 | print(sub3) |
58 | print(api.push_subscription()) | 58 | print(api.push_subscription()) |
59 | 59 | ||
60 | assert sub3.alerts.follow == False | 60 | assert sub3.alerts.follow is False |
61 | assert sub3.alerts.favourite == False | 61 | assert sub3.alerts.favourite is False |
62 | assert sub3.alerts.reblog == False | 62 | assert sub3.alerts.reblog is False |
63 | assert sub3.alerts.mention == False | 63 | assert sub3.alerts.mention is False |
64 | assert sub2.alerts.follow == True | 64 | assert sub2.alerts.follow is True |
65 | assert sub2.alerts.favourite == True | 65 | assert sub2.alerts.favourite is True |
66 | assert sub2.alerts.reblog == True | 66 | assert sub2.alerts.reblog is True |
67 | assert sub2.alerts.mention == True | 67 | assert sub2.alerts.mention is True |
68 | 68 | ||
69 | 69 | ||
70 | @pytest.mark.vcr(match_on=['path']) | 70 | @pytest.mark.vcr(match_on=['path']) |
diff --git a/tests/test_streaming.py b/tests/test_streaming.py index fb60fe1..53a71ee 100644 --- a/tests/test_streaming.py +++ b/tests/test_streaming.py | |||
@@ -20,7 +20,7 @@ close_connections = False | |||
20 | def patch_streaming(): | 20 | def patch_streaming(): |
21 | global streaming_is_patched | 21 | global streaming_is_patched |
22 | global close_connections | 22 | global close_connections |
23 | if streaming_is_patched == True: | 23 | if streaming_is_patched is True: |
24 | return | 24 | return |
25 | streaming_is_patched = True | 25 | streaming_is_patched = True |
26 | 26 | ||
@@ -35,7 +35,7 @@ def patch_streaming(): | |||
35 | response = real_connection_real_get_response(*args, **kwargs) | 35 | response = real_connection_real_get_response(*args, **kwargs) |
36 | real_body = b"" | 36 | real_body = b"" |
37 | try: | 37 | try: |
38 | while close_connections == False: | 38 | while close_connections is False: |
39 | if len(select.select([response], [], [], 0.01)[0]) > 0: | 39 | if len(select.select([response], [], [], 0.01)[0]) > 0: |
40 | chunk = response.read(1) | 40 | chunk = response.read(1) |
41 | real_body += chunk | 41 | real_body += chunk |
@@ -165,7 +165,7 @@ def test_unknown_event(): | |||
165 | 'data: {}', | 165 | 'data: {}', |
166 | '', | 166 | '', |
167 | ]) | 167 | ]) |
168 | assert listener.bla_called == True | 168 | assert listener.bla_called is True |
169 | assert listener.updates == [] | 169 | assert listener.updates == [] |
170 | assert listener.notifications == [] | 170 | assert listener.notifications == [] |
171 | assert listener.deletes == [] | 171 | assert listener.deletes == [] |
@@ -195,7 +195,7 @@ def test_dotted_unknown_event(): | |||
195 | 'data: {}', | 195 | 'data: {}', |
196 | '', | 196 | '', |
197 | ]) | 197 | ]) |
198 | assert listener.do_something_called == True | 198 | assert listener.do_something_called is True |
199 | assert listener.updates == [] | 199 | assert listener.updates == [] |
200 | assert listener.notifications == [] | 200 | assert listener.notifications == [] |
201 | assert listener.deletes == [] | 201 | assert listener.deletes == [] |
diff --git a/tests/test_timeline.py b/tests/test_timeline.py index bc6728f..239fac3 100644 --- a/tests/test_timeline.py +++ b/tests/test_timeline.py | |||
@@ -60,8 +60,8 @@ def test_conversations(api, api2): | |||
60 | assert conversations | 60 | assert conversations |
61 | assert status.id in map(lambda x: x.last_status.id, conversations) | 61 | assert status.id in map(lambda x: x.last_status.id, conversations) |
62 | assert account.id in map(lambda x: x.accounts[0].id, conversations) | 62 | assert account.id in map(lambda x: x.accounts[0].id, conversations) |
63 | assert conversations[0].unread == True | 63 | assert conversations[0].unread is True |
64 | assert conversations2[0].unread == False | 64 | assert conversations2[0].unread is False |
65 | 65 | ||
66 | @pytest.mark.vcr() | 66 | @pytest.mark.vcr() |
67 | def test_min_max_id(api, status): | 67 | def test_min_max_id(api, status): |