aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLorenz Diener <[email protected]>2018-04-18 22:00:35 +0200
committerLorenz Diener <[email protected]>2018-04-18 22:00:35 +0200
commit64ec9e20987072692227d8817d9fd99d497fea5e (patch)
tree7c358d3ce80c30fd59af9e615e99824453eb2f8d /tests/test_status.py
parenta825905b571697835d762ac63098491cbc4a0936 (diff)
downloadmastodon.py-64ec9e20987072692227d8817d9fd99d497fea5e.tar.gz
Update the tests
Diffstat (limited to 'tests/test_status.py')
-rw-r--r--tests/test_status.py14
1 files changed, 10 insertions, 4 deletions
diff --git a/tests/test_status.py b/tests/test_status.py
index 2e129ac..95390b3 100644
--- a/tests/test_status.py
+++ b/tests/test_status.py
@@ -16,11 +16,17 @@ def test_status_missing(api):
16 with pytest.raises(MastodonNotFoundError): 16 with pytest.raises(MastodonNotFoundError):
17 api.status(0) 17 api.status(0)
18 18
19@pytest.mark.skip(reason="Doesn't look like mastodon will make a card for an url that doesn't have a TLD, and relying on some external website being reachable to make a card of is messy :/") 19# Messy and will only work if there is an internet connection that is decent, obviously.
20@pytest.mark.vcr()
20def test_status_card(api): 21def test_status_card(api):
21 status = api.status_post("http://localhost:3000") 22 import time
23 status = api.status_post("http://example.org/")
24 time.sleep(5) # Card generation may take time
22 card = api.status_card(status['id']) 25 card = api.status_card(status['id'])
23 assert card 26 try:
27 assert card
28 finally:
29 api.status_delete(status['id'])
24 30
25@pytest.mark.vcr() 31@pytest.mark.vcr()
26def test_status_context(status, api): 32def test_status_context(status, api):
@@ -48,7 +54,7 @@ def test_toot(api):
48 api.status_delete(status['id']) 54 api.status_delete(status['id'])
49 55
50@pytest.mark.vcr() 56@pytest.mark.vcr()
51@pytest.mark.parametrize('visibility', ('', 'direct', 'private', 'unlisted', 'public', 57@pytest.mark.parametrize('visibility', (None, 'direct', 'private', 'unlisted', 'public',
52 pytest.param('foobar', marks=pytest.mark.xfail(strict=True)))) 58 pytest.param('foobar', marks=pytest.mark.xfail(strict=True))))
53@pytest.mark.parametrize('spoiler_text', (None, 'Content warning')) 59@pytest.mark.parametrize('spoiler_text', (None, 'Content warning'))
54def test_status_post(api, visibility, spoiler_text): 60def test_status_post(api, visibility, spoiler_text):
Powered by cgit v1.2.3 (git 2.41.0)