1
Fork 0
mirror of https://github.com/thegeneralist01/twitter-openapi synced 2026-01-11 15:40:26 +01:00

add test case

Signed-off-by: ふぁ <yuki@yuki0311.com>
This commit is contained in:
ふぁ 2024-02-14 11:11:56 +09:00
parent d33b37b200
commit 03a1fecde6
No known key found for this signature in database
GPG key ID: 83A8A5E74872A8AA

View file

@ -294,27 +294,38 @@ if __name__ == "__main__":
error_dump(e)
error_count += 1
try:
logger.info("Try: Self UserTweets Test")
kwargs = get_kwargs("UserTweets", {"userId": "1180389371481976833"})
res = pt.TweetApi(api_client).get_user_tweets_with_http_info(**kwargs)
data = res.data.to_dict()
ids = [
"1180389371481976833",
"900282258736545792",
"1212617657003859968",
"2455740283",
"2326837940",
]
for id in ids:
try:
logger.info("Try: Self UserTweets Test")
kwargs = get_kwargs("UserTweets", {"userId": id})
res = pt.TweetApi(api_client).get_user_tweets_with_http_info(**kwargs)
data = res.data.to_dict()
rate = match_rate(
data,
json.loads(res.raw_data),
res.data,
)
logger.info(f"Match rate: {rate}")
rate = match_rate(
data,
json.loads(res.raw_data),
res.data,
)
logger.info(f"Match rate: {rate}")
except Exception as e:
error_dump(e)
error_count += 1
except Exception as e:
error_dump(e)
error_count += 1
ids = [
"1720975693524377759",
"1721006592303251551",
"1606661809075019776",
"1739194269477331076",
"1697450269259522256",
"1697450278742884799",
"1749500209061663043",
]
for id in ids:
try: