From 9a9604896c4d586a56b4e53c055a5f762bbaab0d Mon Sep 17 00:00:00 2001 From: codl Date: Thu, 30 Nov 2017 02:26:28 +0100 Subject: add test for favourites --- tests/cassettes/test_favourites.yaml | 27 +++++++++++++++++++++++++++ tests/test_status.py | 5 +++++ 2 files changed, 32 insertions(+) create mode 100644 tests/cassettes/test_favourites.yaml diff --git a/tests/cassettes/test_favourites.yaml b/tests/cassettes/test_favourites.yaml new file mode 100644 index 0000000..1bba85f --- /dev/null +++ b/tests/cassettes/test_favourites.yaml @@ -0,0 +1,27 @@ +interactions: +- request: + body: null + headers: + Accept: ['*/*'] + Accept-Encoding: ['gzip, deflate'] + Authorization: [Bearer __MASTODON_PY_TEST_ACCESS_TOKEN] + Connection: [keep-alive] + User-Agent: [python-requests/2.18.4] + method: GET + uri: http://localhost:3000/api/v1/favourites + response: + body: {string: '[]'} + headers: + Cache-Control: ['max-age=0, private, must-revalidate'] + Content-Type: [application/json; charset=utf-8] + ETag: [W/"81bd415584c93a9b65e719202c32c8f6"] + Transfer-Encoding: [chunked] + Vary: ['Accept-Encoding, Origin'] + X-Content-Type-Options: [nosniff] + X-Frame-Options: [SAMEORIGIN] + X-Request-Id: [0cc085dc-b2c7-4524-9dbf-4b9449f4aa79] + X-Runtime: ['0.029419'] + X-XSS-Protection: [1; mode=block] + content-length: ['2'] + status: {code: 200, message: OK} +version: 1 diff --git a/tests/test_status.py b/tests/test_status.py index a5b8b3a..ab8540f 100644 --- a/tests/test_status.py +++ b/tests/test_status.py @@ -81,6 +81,11 @@ def test_status_fav_unfav(status, api): status = api.status_unfavourite(status['id']) assert not status['favourited'] +@pytest.mark.vcr() +def test_favourites(api): + favs = api.favourites() + assert isinstance(favs, list) + @pytest.mark.vcr() def test_status_mute_unmute(status, api): -- cgit v1.2.3