diff options
Diffstat (limited to 'tests/test_account.py')
-rw-r--r-- | tests/test_account.py | 48 |
1 files changed, 27 insertions, 21 deletions
diff --git a/tests/test_account.py b/tests/test_account.py index 2e823d1..f2a608a 100644 --- a/tests/test_account.py +++ b/tests/test_account.py | |||
@@ -5,7 +5,7 @@ import time | |||
5 | 5 | ||
6 | @pytest.mark.vcr() | 6 | @pytest.mark.vcr() |
7 | def test_account(api): | 7 | def test_account(api): |
8 | account = api.account(1) | 8 | account = api.account(1234567890123456) |
9 | assert account | 9 | assert account |
10 | 10 | ||
11 | @pytest.mark.vcr() | 11 | @pytest.mark.vcr() |
@@ -17,19 +17,19 @@ def test_verify_credentials(api): | |||
17 | 17 | ||
18 | @pytest.mark.vcr() | 18 | @pytest.mark.vcr() |
19 | def test_account_following(api): | 19 | def test_account_following(api): |
20 | following = api.account_following(1) | 20 | following = api.account_following(1234567890123456) |
21 | assert isinstance(following, list) | 21 | assert isinstance(following, list) |
22 | 22 | ||
23 | 23 | ||
24 | @pytest.mark.vcr() | 24 | @pytest.mark.vcr() |
25 | def test_account_followers(api): | 25 | def test_account_followers(api): |
26 | followers = api.account_followers(1) | 26 | followers = api.account_followers(1234567890123456) |
27 | assert isinstance(followers, list) | 27 | assert isinstance(followers, list) |
28 | 28 | ||
29 | 29 | ||
30 | @pytest.mark.vcr() | 30 | @pytest.mark.vcr() |
31 | def test_account_relationships(api): | 31 | def test_account_relationships(api): |
32 | relationships = api.account_relationships(1) | 32 | relationships = api.account_relationships(1234567890123456) |
33 | assert isinstance(relationships, list) | 33 | assert isinstance(relationships, list) |
34 | assert len(relationships) == 1 | 34 | assert len(relationships) == 1 |
35 | 35 | ||
@@ -40,7 +40,7 @@ def test_account_search(api): | |||
40 | admin_acc = results[0] | 40 | admin_acc = results[0] |
41 | 41 | ||
42 | assert isinstance(results, list) | 42 | assert isinstance(results, list) |
43 | assert len(results) == 1 | 43 | assert len(results) == 2 |
44 | 44 | ||
45 | api.account_follow(admin_acc) | 45 | api.account_follow(admin_acc) |
46 | results = api.account_search('admin', following = True) | 46 | results = api.account_search('admin', following = True) |
@@ -54,40 +54,41 @@ def test_account_search(api): | |||
54 | 54 | ||
55 | results = api.account_search('admin') | 55 | results = api.account_search('admin') |
56 | assert isinstance(results, list) | 56 | assert isinstance(results, list) |
57 | assert len(results) == 1 | 57 | assert len(results) == 2 |
58 | 58 | ||
59 | @pytest.mark.vcr() | 59 | @pytest.mark.vcr() |
60 | def test_account_follow_unfollow(api): | 60 | def test_account_follow_unfollow(api): |
61 | relationship = api.account_follow(1) | 61 | relationship = api.account_follow(1234567890123457) |
62 | try: | 62 | try: |
63 | assert relationship | 63 | assert relationship |
64 | print(relationship) | ||
64 | assert relationship['following'] | 65 | assert relationship['following'] |
65 | finally: | 66 | finally: |
66 | relationship = api.account_unfollow(1) | 67 | relationship = api.account_unfollow(1234567890123457) |
67 | assert relationship | 68 | assert relationship |
68 | assert not relationship['following'] | 69 | assert not relationship['following'] |
69 | 70 | ||
70 | 71 | ||
71 | @pytest.mark.vcr() | 72 | @pytest.mark.vcr() |
72 | def test_account_block_unblock(api): | 73 | def test_account_block_unblock(api): |
73 | relationship = api.account_block(1) | 74 | relationship = api.account_block(1234567890123457) |
74 | try: | 75 | try: |
75 | assert relationship | 76 | assert relationship |
76 | assert relationship['blocking'] | 77 | assert relationship['blocking'] |
77 | finally: | 78 | finally: |
78 | relationship = api.account_unblock(1) | 79 | relationship = api.account_unblock(1234567890123457) |
79 | assert relationship | 80 | assert relationship |
80 | assert not relationship['blocking'] | 81 | assert not relationship['blocking'] |
81 | 82 | ||
82 | 83 | ||
83 | @pytest.mark.vcr() | 84 | @pytest.mark.vcr() |
84 | def test_account_mute_unmute(api): | 85 | def test_account_mute_unmute(api): |
85 | relationship = api.account_mute(1) | 86 | relationship = api.account_mute(1234567890123457) |
86 | try: | 87 | try: |
87 | assert relationship | 88 | assert relationship |
88 | assert relationship['muting'] | 89 | assert relationship['muting'] |
89 | finally: | 90 | finally: |
90 | relationship = api.account_unmute(1) | 91 | relationship = api.account_unmute(1234567890123457) |
91 | assert relationship | 92 | assert relationship |
92 | assert not relationship['muting'] | 93 | assert not relationship['muting'] |
93 | 94 | ||
@@ -231,16 +232,21 @@ def test_suggested_tags(api): | |||
231 | 232 | ||
232 | @pytest.mark.vcr() | 233 | @pytest.mark.vcr() |
233 | def test_featured_tags(api): | 234 | def test_featured_tags(api): |
234 | featured_tag = api.featured_tag_create("mastopytesttag") | 235 | try: |
235 | assert featured_tag | 236 | status = api.status_post("cool free #ringtones") |
236 | 237 | time.sleep(2) | |
237 | tag_list = api.featured_tags() | 238 | |
238 | assert featured_tag.name in list(map(lambda x: x.name, tag_list)) | 239 | featured_tag = api.featured_tag_create("ringtones") |
239 | 240 | assert featured_tag | |
240 | api.featured_tag_delete(featured_tag) | 241 | |
241 | tag_list = api.featured_tags() | 242 | tag_list = api.featured_tags() |
242 | assert not featured_tag.name in list(map(lambda x: x.name, tag_list)) | 243 | assert featured_tag.name in list(map(lambda x: x.name, tag_list)) |
243 | 244 | ||
245 | api.featured_tag_delete(featured_tag) | ||
246 | tag_list = api.featured_tags() | ||
247 | assert not featured_tag.name in list(map(lambda x: x.name, tag_list)) | ||
248 | finally: | ||
249 | api.status_delete(status) | ||
244 | 250 | ||
245 | 251 | ||
246 | 252 | ||