From 3194b1295e8f4a6d151d18ad4f23174c63408c05 Mon Sep 17 00:00:00 2001 From: Lorenz Diener Date: Sat, 12 Oct 2019 21:02:39 +0200 Subject: Re-add and test trends API --- tests/cassettes/test_trends.yaml | 29 +++++++++++++++++++++++++++++ tests/test_instance.py | 5 +++++ 2 files changed, 34 insertions(+) create mode 100644 tests/cassettes/test_trends.yaml (limited to 'tests') diff --git a/tests/cassettes/test_trends.yaml b/tests/cassettes/test_trends.yaml new file mode 100644 index 0000000..15cfd9b --- /dev/null +++ b/tests/cassettes/test_trends.yaml @@ -0,0 +1,29 @@ +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/trends + response: + body: {string: '[]'} + headers: + Cache-Control: ['no-cache, no-store'] + Content-Type: [application/json; charset=utf-8] + Referrer-Policy: [strict-origin-when-cross-origin] + Transfer-Encoding: [chunked] + Vary: ['Accept-Encoding, Origin'] + X-Content-Type-Options: [nosniff] + X-Download-Options: [noopen] + X-Frame-Options: [SAMEORIGIN] + X-Permitted-Cross-Domain-Policies: [none] + X-Request-Id: [cd891bac-8b4d-476e-b767-2346ff6f498e] + X-Runtime: ['0.074803'] + X-XSS-Protection: [1; mode=block] + content-length: ['2'] + status: {code: 200, message: OK} +version: 1 diff --git a/tests/test_instance.py b/tests/test_instance.py index 343af18..e7dee1f 100644 --- a/tests/test_instance.py +++ b/tests/test_instance.py @@ -43,3 +43,8 @@ def test_nodeinfo(api): assert nodeinfo assert nodeinfo.version == '2.0' + +@pytest.mark.vcr() +def test_trends(api): + assert isinstance(api.trends(), list) + -- cgit v1.2.3