add test command

This commit is contained in:
2023-06-01 00:04:20 +03:00
parent 728373cdd5
commit d10f9a52be
2 changed files with 87 additions and 65 deletions

View File

@@ -137,3 +137,6 @@ class E621:
async def get_posts(self, tags='', page=1, limit=50) -> List[E621Post]:
r = (await self.client.get('/posts.json', params={'tags': tags, 'page': page, 'limit': limit})).json()
return [E621Post.from_dict(p) for p in r['posts']]
async def get_post(self, post_id: str) -> E621Post:
return (await self.get_posts(f'id:{post_id}'))[0]