Skip to content

Commit

Permalink
3.2.0
Browse files Browse the repository at this point in the history
  • Loading branch information
wkpn committed Dec 14, 2020
1 parent b33afcc commit 03aa5bd
Show file tree
Hide file tree
Showing 13 changed files with 32 additions and 14 deletions.
8 changes: 8 additions & 0 deletions CHANGELOG-ru.rst
@@ -1,6 +1,14 @@
Изменения
=========

`3.2.0`
-------

* апдейт версии `httpx`
* апдейт тестов



`3.1.2`
-------

Expand Down
7 changes: 7 additions & 0 deletions CHANGELOG.rst
@@ -1,6 +1,13 @@
Changelog
=========

`3.2.0`
-------

* bump `httpx` version
* update tests


`3.1.2`
-------

Expand Down
2 changes: 1 addition & 1 deletion LICENSE
@@ -1,6 +1,6 @@
MIT License

Copyright (c) 2018-2020 https://github.com/wkpn
Copyright (c) 2018-present https://github.com/wkpn

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
Expand Down
1 change: 1 addition & 0 deletions README-ru.rst
Expand Up @@ -48,6 +48,7 @@
>>> async with Api() as client:
... boards = await client.get_boards()
>>> ...
Получить все доски

Expand Down
1 change: 1 addition & 0 deletions README.rst
Expand Up @@ -48,6 +48,7 @@ Or you can use it as a context manager
>>> async with Api() as client:
... boards = await client.get_boards()
>>> ...
Get all boards

Expand Down
2 changes: 1 addition & 1 deletion aio2ch/__version__.py
@@ -1 +1 @@
__version__ = "3.1.2"
__version__ = "3.2.0"
2 changes: 1 addition & 1 deletion examples/basic_usage.py
Expand Up @@ -17,7 +17,7 @@ async def main():
keywords_threads = await client.get_board_threads(board="test", keywords=("keywords", "to", "search", "for"))

# ok, we know for sure that this thread (https://2ch.hk/test/res/30972.html) has some media in it, lets get it
thread_media = await client.get_thread_media(30972, "test")
thread_media = await client.get_thread_media(31814, "test")

# thread_media is a list of Files, lets save them to our folder (make sure it exists first)
await client.download_thread_media(thread_media, save_to="./downloads")
Expand Down
2 changes: 1 addition & 1 deletion requirements.txt
@@ -1,3 +1,3 @@
httpx==0.13.*
httpx[http2]==0.16.*
aiofiles
click
3 changes: 2 additions & 1 deletion setup.py
Expand Up @@ -47,7 +47,8 @@ def get_packages(package):
"License :: OSI Approved :: MIT License",
"Programming Language :: Python :: 3.6",
"Programming Language :: Python :: 3.7",
"Programming Language :: Python :: 3.8"
"Programming Language :: Python :: 3.8",
"Programming Language :: Python :: 3.9"
],
entry_points={
"console_scripts": [
Expand Down
10 changes: 5 additions & 5 deletions tests/conftest.py
Expand Up @@ -48,10 +48,10 @@ def board():


@pytest.fixture
def thread():
def thread(thread_as_number):
test_thread_data = {
"comment": "",
"num": 30972,
"num": thread_as_number,
"posts_count": "",
"score": "",
"subject": "",
Expand All @@ -65,12 +65,12 @@ def thread():

@pytest.fixture
def thread_as_number():
return 30972
return 31814


@pytest.fixture
def thread_url():
return "https://2ch.hk/test/res/30972.html"
def thread_url(thread_as_number):
return f"https://2ch.hk/test/res/{thread_as_number}.html"


@pytest.fixture
Expand Down
2 changes: 1 addition & 1 deletion tests/test_exceptions.py
Expand Up @@ -21,7 +21,7 @@ async def test_get_top_board_threads_invalid_board(client, invalid_board):


@pytest.mark.asyncio
async def test_get_top_board_threads_str_wrong_sort_method(client):
async def test_get_top_board_threads_str_wrong_sort_method(client, board):
with pytest.raises(WrongSortMethodException):
await client.get_top_board_threads(board="test", method="WrongSortMethod")

Expand Down
4 changes: 2 additions & 2 deletions tests/test_helpers.py
Expand Up @@ -7,8 +7,8 @@ def test_clean_html_tags(raw_text, clean_text):
assert clean == clean_text


def test_get_board_and_thread_from_url(thread_url):
def test_get_board_and_thread_from_url(thread_url, thread_as_number):
board, thread = get_board_and_thread_from_url(thread_url)

assert board == "test"
assert thread == "30972"
assert thread == f"{thread_as_number}"
2 changes: 1 addition & 1 deletion tests/test_posts.py
Expand Up @@ -35,7 +35,7 @@ async def test_get_thread_posts_with_status_by_url(client, thread_url):

@pytest.mark.asyncio
async def test_get_thread_posts_with_board_instance(client, thread_as_number, board):
posts = await client.get_thread_posts(30972, board=board)
posts = await client.get_thread_posts(thread_as_number, board=board)

assert all(isinstance(post, Post) for post in posts)

0 comments on commit 03aa5bd

Please sign in to comment.