mirror of
https://github.com/thegeneralist01/twitter-openapi
synced 2026-01-11 23:50:26 +01:00
add test case
Signed-off-by: ふぁ <yuki@yuki0311.com>
This commit is contained in:
parent
d33b37b200
commit
03a1fecde6
1 changed files with 26 additions and 15 deletions
|
|
@ -294,27 +294,38 @@ if __name__ == "__main__":
|
||||||
error_dump(e)
|
error_dump(e)
|
||||||
error_count += 1
|
error_count += 1
|
||||||
|
|
||||||
try:
|
ids = [
|
||||||
logger.info("Try: Self UserTweets Test")
|
"1180389371481976833",
|
||||||
kwargs = get_kwargs("UserTweets", {"userId": "1180389371481976833"})
|
"900282258736545792",
|
||||||
res = pt.TweetApi(api_client).get_user_tweets_with_http_info(**kwargs)
|
"1212617657003859968",
|
||||||
data = res.data.to_dict()
|
"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(
|
rate = match_rate(
|
||||||
data,
|
data,
|
||||||
json.loads(res.raw_data),
|
json.loads(res.raw_data),
|
||||||
res.data,
|
res.data,
|
||||||
)
|
)
|
||||||
logger.info(f"Match rate: {rate}")
|
logger.info(f"Match rate: {rate}")
|
||||||
|
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
error_dump(e)
|
error_dump(e)
|
||||||
error_count += 1
|
error_count += 1
|
||||||
|
|
||||||
ids = [
|
ids = [
|
||||||
"1720975693524377759",
|
"1720975693524377759",
|
||||||
"1721006592303251551",
|
"1721006592303251551",
|
||||||
"1606661809075019776",
|
"1739194269477331076",
|
||||||
|
"1697450269259522256",
|
||||||
|
"1697450278742884799",
|
||||||
|
"1749500209061663043",
|
||||||
]
|
]
|
||||||
for id in ids:
|
for id in ids:
|
||||||
try:
|
try:
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue