diff options
Diffstat (limited to 'tests/test_account.py')
-rw-r--r-- | tests/test_account.py | 31 |
1 files changed, 31 insertions, 0 deletions
diff --git a/tests/test_account.py b/tests/test_account.py index 77a8f48..cd7633d 100644 --- a/tests/test_account.py +++ b/tests/test_account.py | |||
@@ -175,3 +175,34 @@ def test_follow_suggestions(api2, status): | |||
175 | suggestions2 = api2.suggestions() | 175 | suggestions2 = api2.suggestions() |
176 | assert(len(suggestions2) < len(suggestions)) | 176 | assert(len(suggestions2) < len(suggestions)) |
177 | 177 | ||
178 | @pytest.mark.vcr() | ||
179 | def test_account_pin_unpin(api, api2): | ||
180 | user = api2.account_verify_credentials() | ||
181 | |||
182 | # Make sure we are in the correct state | ||
183 | try: | ||
184 | api.account_follow(user) | ||
185 | except: | ||
186 | pass | ||
187 | |||
188 | try: | ||
189 | api.account_unpin(user) | ||
190 | except: | ||
191 | pass | ||
192 | |||
193 | relationship = api.account_pin(user) | ||
194 | endorsed = api.endorsements() | ||
195 | |||
196 | try: | ||
197 | assert relationship | ||
198 | assert relationship['endorsed'] | ||
199 | assert user["id"] in map(lambda x: x["id"], endorsed) | ||
200 | finally: | ||
201 | relationship = api.account_unpin(user) | ||
202 | endorsed2 = api.endorsements() | ||
203 | api.account_unfollow(user) | ||
204 | assert relationship | ||
205 | assert not relationship['endorsed'] | ||
206 | assert not user["id"] in map(lambda x: x["id"], endorsed2) | ||
207 | |||
208 | |||