forked from stanfordio/gogettr
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtest_all.py
More file actions
29 lines (19 loc) · 801 Bytes
/
test_all.py
File metadata and controls
29 lines (19 loc) · 801 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
"""Tests for the 'all' capability."""
from gogettr import PublicClient
client = PublicClient()
def test_all_posts():
"""Verifies we can extract the first five posts."""
posts = list(client.all(max=5))
assert len(posts) == 5
def test_user_posts_downward():
"""Verifies that we can pull posts backward."""
posts = list(client.all(last="pew9", max=10, order="down"))
assert len(posts) == 10
def test_user_posts_limited_id():
"""Verifies that we can pull posts backward with an ID as the endpoint."""
posts = list(client.all(last="pew9", first="pew0", order="down"))
assert len(posts) > 0
def test_all_comments():
"""Verifies we can extract the first five comments."""
comments = list(client.all(max=5, type="comments"))
assert len(comments) == 5