-
Notifications
You must be signed in to change notification settings - Fork 0
/
test_posts.py
41 lines (24 loc) · 1.13 KB
/
test_posts.py
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
30
31
32
33
34
35
36
37
38
39
40
from aio2ch import Post
import pytest
@pytest.mark.asyncio
async def test_get_thread_posts(client, thread):
posts = await client.get_thread_posts(thread)
assert all(isinstance(post, Post) for post in posts)
@pytest.mark.asyncio
async def test_get_thread_posts_by_url(client, thread_url):
posts = await client.get_thread_posts(thread_url)
assert all(isinstance(post, Post) for post in posts)
@pytest.mark.asyncio
async def test_get_thread_posts_with_status(client, thread):
status, posts = await client.get_thread_posts(thread, return_status=True)
assert status >= 200
assert all(isinstance(post, Post) for post in posts)
@pytest.mark.asyncio
async def test_get_thread_posts_with_status_by_url(client, thread_url):
status, posts = await client.get_thread_posts(thread_url, return_status=True)
assert status >= 200
assert all(isinstance(post, Post) for post in posts)
@pytest.mark.asyncio
async def test_get_thread_posts_with_board_instance(client, thread_as_number, board):
posts = await client.get_thread_posts(thread_as_number, board=board)
assert all(isinstance(post, Post) for post in posts)