More tests & Proper syndication token calc

This commit is contained in:
Dylan
2023-08-15 17:03:00 +01:00
parent d7f6599a33
commit fcc89d62cf
2 changed files with 41 additions and 3 deletions

View File

@ -44,6 +44,15 @@ def compareDict(original,compare):
else:
compareDict(original[key],compare[key])
## Specific API tests ##
def test_syndicationAPI():
tweet = twExtract.extractStatus_syndication(testMediaTweet,workaroundTokens=tokens)
assert tweet["full_text"]==testMedia_compare['description']
def test_v2API():
tweet = twExtract.extractStatusV2Legacy(testMediaTweet,workaroundTokens=tokens)
assert tweet["full_text"]==testMedia_compare['description']
## Tweet retrieve tests ##
def test_textTweetExtract():
tweet = twExtract.extractStatus(testTextTweet,workaroundTokens=tokens)
@ -253,4 +262,7 @@ def test_combine():
resp = client.get(f"/rendercombined.jpg?imgs={img1},{img2}",headers={"User-Agent":"test"})
assert resp.status_code==200
assert resp.headers["Content-Type"]=="image/jpeg"
assert len(resp.data)>1000
assert len(resp.data)>1000
def test_calcSyndicationToken():
assert twExtract.calcSyndicationToken("1691389765483200513") == "43lnobuxzql"