Skip to content

Commit 747e316

Browse files
authored
Merge pull request #11 from fa0311/develop
v0.0.10
2 parents 0922b4b + 687789f commit 747e316

14 files changed

Lines changed: 72 additions & 8 deletions

twitter_openapi_python/pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[tool.poetry]
22
name = "twitter_openapi_python"
3-
version = "0.0.9"
3+
version = "0.0.10"
44
description = "Twitter OpenAPI"
55
authors = ["fa0311 <[email protected]>"]
66
license = "proprietary" # or "AGPL-3.0-only"

twitter_openapi_python/setup.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
from setuptools import find_packages, setup
44

55
NAME = "twitter_openapi_python"
6-
VERSION = "0.0.9"
6+
VERSION = "0.0.10"
77
PYTHON_REQUIRES = ">=3.7"
88
REQUIRES = [
99
"twitter_openapi_python_generated == 0.0.6",

twitter_openapi_python/test/api.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,11 @@ def get_client() -> api.TwitterOpenapiPythonClient:
1818
return client
1919

2020

21+
def get_guest_client() -> api.TwitterOpenapiPythonClient:
22+
client = api.TwitterOpenapiPython().get_guest_client()
23+
return client
24+
25+
2126
def print_tweet(tweet: api.TweetApiUtilsData) -> None:
2227
print_legacy_tweet(tweet.user.legacy, tweet.tweet.legacy)
2328
for reply in tweet.replies:
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
import logging
2+
import unittest
3+
from test.api import get_guest_client
4+
5+
import twitter_openapi_python as api
6+
7+
8+
class TestGuestDefaultApi(unittest.TestCase):
9+
client: api.DefaultApiUtils
10+
11+
def setUp(self):
12+
self.client = get_guest_client().get_default_api()
13+
14+
def test_get_tweet_result_by_rest_id(self):
15+
result = self.client.get_tweet_result_by_rest_id(tweet_id="1349129669258448897")
16+
17+
assert result.data is not None
18+
assert result.data.tweet.legacy is not None
19+
logging.info(result.data.tweet.legacy.full_text)
20+
21+
22+
if __name__ == "__main__":
23+
unittest.main()
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
import unittest
2+
from test.api import get_guest_client, print_user
3+
4+
import twitter_openapi_python as api
5+
6+
7+
class TestGuestUserApi(unittest.TestCase):
8+
client: api.UserApiUtils
9+
10+
def setUp(self):
11+
self.client = get_guest_client().get_user_api()
12+
13+
def test_get_user_by_screen_name(self):
14+
result = self.client.get_user_by_screen_name(screen_name="elonmusk")
15+
print_user(result.data)
16+
17+
18+
if __name__ == "__main__":
19+
unittest.main()
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.

twitter_openapi_python/test/api/test_user_list_api.py renamed to twitter_openapi_python/test/api/test_1_user_list_api.py

File renamed without changes.

0 commit comments

Comments
 (0)