File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 11[tool .poetry ]
22name = " twitter_openapi_python"
3- version = " 0.0.9 "
3+ version = " 0.0.10 "
44description = " Twitter OpenAPI"
55authors = [
" fa0311 <[email protected] >" ]
66license = " proprietary" # or "AGPL-3.0-only"
Original file line number Diff line number Diff line change 33from setuptools import find_packages , setup
44
55NAME = "twitter_openapi_python"
6- VERSION = "0.0.9 "
6+ VERSION = "0.0.10 "
77PYTHON_REQUIRES = ">=3.7"
88REQUIRES = [
99 "twitter_openapi_python_generated == 0.0.6" ,
Original file line number Diff line number Diff 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+
2126def print_tweet (tweet : api .TweetApiUtilsData ) -> None :
2227 print_legacy_tweet (tweet .user .legacy , tweet .tweet .legacy )
2328 for reply in tweet .replies :
Original file line number Diff line number Diff line change 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 ()
Original file line number Diff line number Diff line change 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.
File renamed without changes.
You can’t perform that action at this time.
0 commit comments