aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLorenz Diener <[email protected]>2017-11-29 17:48:56 +0100
committerGitHub <[email protected]>2017-11-29 17:48:56 +0100
commit961425e2abc91d693004f2c0d073e387de64e58c (patch)
tree8b1512daf97ab63b54f4edebc83b35f524571c53 /tests/test_hooks.py
parent5b811b719d379be06ed256da2ee806a051461795 (diff)
parente79987df2410ee32302abed9e486a72b2dfc9707 (diff)
downloadmastodon.py-961425e2abc91d693004f2c0d073e387de64e58c.tar.gz
Merge pull request #109 from codl/test-suite
Test suite
Diffstat (limited to 'tests/test_hooks.py')
-rw-r--r--tests/test_hooks.py32
1 files changed, 32 insertions, 0 deletions
diff --git a/tests/test_hooks.py b/tests/test_hooks.py
new file mode 100644
index 0000000..905672d
--- /dev/null
+++ b/tests/test_hooks.py
@@ -0,0 +1,32 @@
1import pytest
2from datetime import datetime
3
4
5@pytest.mark.vcr()
6def test_id_hook(status):
7 assert isinstance(status['id'], int)
8
9
10@pytest.mark.xfail(reason='fixed in upstream')
11@pytest.mark.vcr()
12def test_id_hook_in_reply_to(api, status):
13 reply = api.status_post('Reply!', in_reply_to_id=status['id'])
14 try:
15 assert isinstance(reply['in_reply_to_id'], int)
16 assert isinstance(reply['in_reply_to_account_id'], int)
17 finally:
18 api.status_delete(reply['id'])
19
20
21@pytest.mark.vcr()
22def test_id_hook_within_reblog(api, status):
23 reblog = api.status_reblog(status['id'])
24 try:
25 assert isinstance(reblog['reblog']['id'], int)
26 finally:
27 api.status_delete(reblog['id'])
28
29
30@pytest.mark.vcr()
31def test_date_hook(status):
32 assert isinstance(status['created_at'], datetime)
Powered by cgit v1.2.3 (git 2.41.0)