From fbd4122fec092bff6b1cc9f44dfeda6ee693c41b Mon Sep 17 00:00:00 2001 From: Lorenz Diener Date: Sun, 6 May 2018 15:52:55 +0200 Subject: [PATCH] Add emoji test --- tests/cassettes/test_emoji.yaml | 27 +++++++++++++++++++++++++++ tests/test_instance.py | 5 ++++- 2 files changed, 31 insertions(+), 1 deletion(-) create mode 100644 tests/cassettes/test_emoji.yaml diff --git a/tests/cassettes/test_emoji.yaml b/tests/cassettes/test_emoji.yaml new file mode 100644 index 0000000..8d83735 --- /dev/null +++ b/tests/cassettes/test_emoji.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.9.1] + method: GET + uri: http://localhost:3000/api/v1/custom_emojis + response: + body: {string: '[]'} + headers: + Cache-Control: ['max-age=0, private, must-revalidate'] + Content-Type: [application/json; charset=utf-8] + ETag: [W/"ea5c10937cbba90ee4e0577b7d86961c"] + Transfer-Encoding: [chunked] + Vary: ['Accept-Encoding, Origin'] + X-Content-Type-Options: [nosniff] + X-Frame-Options: [SAMEORIGIN] + X-Request-Id: [b4431da4-958a-4fe3-8129-ac05eefacb5c] + X-Runtime: ['0.029122'] + 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 e8be86f..199e654 100644 --- a/tests/test_instance.py +++ b/tests/test_instance.py @@ -28,4 +28,7 @@ def test_instance_peers(api): def test_low_version(api_low_version): with pytest.raises(MastodonVersionError): instance = api_low_version.instance() - \ No newline at end of file + +@pytest.mark.vcr() +def test_emoji(api): + assert len(api.custom_emojis()) == 0 \ No newline at end of file