From 21464aa3c66401b022e49eac4d279ba380dcaf16 Mon Sep 17 00:00:00 2001 From: Lorenz Diener Date: Sat, 14 Jul 2018 01:03:42 +0200 Subject: Add regression test for account_search --- tests/test_account.py | 20 ++++++++++++++++++-- 1 file changed, 18 insertions(+), 2 deletions(-) (limited to 'tests') diff --git a/tests/test_account.py b/tests/test_account.py index 4936c11..0a2e870 100644 --- a/tests/test_account.py +++ b/tests/test_account.py @@ -30,9 +30,25 @@ def test_account_relationships(api): @pytest.mark.vcr() def test_account_search(api): results = api.account_search('admin') + admin_acc = results[0] + assert isinstance(results, list) + assert len(results) == 1 - + api.account_follow(admin_acc) + results = api.account_search('admin', following = True) + assert isinstance(results, list) + assert len(results) == 1 + + api.account_unfollow(admin_acc) + results = api.account_search('admin', following = True) + assert isinstance(results, list) + assert len(results) == 0 + + results = api.account_search('admin') + assert isinstance(results, list) + assert len(results) == 1 + @pytest.mark.vcr() def test_account_follow_unfollow(api): relationship = api.account_follow(1) @@ -145,4 +161,4 @@ def test_account_pinned(status, status2, api): assert status in pinned assert not status2 in pinned finally: - api.status_unpin(status['id']) \ No newline at end of file + api.status_unpin(status['id']) -- cgit v1.2.3