From e60a3f1892bb685fcbe6ebbc9ed10602c9549028 Mon Sep 17 00:00:00 2001 From: Lorenz Diener Date: Sat, 12 Oct 2019 20:25:55 +0200 Subject: Add and document health API. Fixes #202 --- tests/cassettes/test_health.yaml | 30 ++++++++++++++++++++++++++++++ tests/test_instance.py | 4 ++++ 2 files changed, 34 insertions(+) create mode 100644 tests/cassettes/test_health.yaml (limited to 'tests') diff --git a/tests/cassettes/test_health.yaml b/tests/cassettes/test_health.yaml new file mode 100644 index 0000000..ff8e97d --- /dev/null +++ b/tests/cassettes/test_health.yaml @@ -0,0 +1,30 @@ +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/health + response: + body: {string: success} + headers: + Cache-Control: ['max-age=0, private, must-revalidate'] + Content-Type: [text/plain; charset=utf-8] + Last-Modified: ['Sat, 12 Oct 2019 18:23:49 GMT'] + Referrer-Policy: [strict-origin-when-cross-origin] + Transfer-Encoding: [chunked] + Vary: [Accept-Encoding] + X-Content-Type-Options: [nosniff] + X-Download-Options: [noopen] + X-Frame-Options: [SAMEORIGIN] + X-Permitted-Cross-Domain-Policies: [none] + X-Request-Id: [13fff315-deaa-47c3-9138-d61d02c5063e] + X-Runtime: ['0.311003'] + X-XSS-Protection: [1; mode=block] + content-length: ['7'] + status: {code: 200, message: OK} +version: 1 diff --git a/tests/test_instance.py b/tests/test_instance.py index 0eebc57..a304585 100644 --- a/tests/test_instance.py +++ b/tests/test_instance.py @@ -32,3 +32,7 @@ def test_low_version(api_low_version): @pytest.mark.vcr() def test_emoji(api): assert len(api.custom_emojis()) == 0 + +@pytest.mark.vcr() +def test_health(api): + assert api.instance_health() == True -- cgit v1.2.3