Direct embed and 404 tweet tests
This commit is contained in:
15
test_vx.py
15
test_vx.py
@ -3,9 +3,8 @@ from wsgiref import headers
|
||||
os.environ["RUNNING_TESTS"]="1"
|
||||
|
||||
import twitfix,twExtract
|
||||
import pytest
|
||||
import json
|
||||
import cache
|
||||
import msgs
|
||||
from flask.testing import FlaskClient
|
||||
client = FlaskClient(twitfix.app)
|
||||
|
||||
@ -133,4 +132,14 @@ def test_embedFromOutdatedCache(): # presets a cache that has VNF's with missing
|
||||
resp = client.get(testMediaTweet.replace("https://twitter.com",""),headers={"User-Agent":"test"})
|
||||
assert resp.status_code==200
|
||||
resp = client.get(testMultiMediaTweet.replace("https://twitter.com",""),headers={"User-Agent":"test"})
|
||||
assert resp.status_code==200
|
||||
assert resp.status_code==200
|
||||
|
||||
def test_directEmbed():
|
||||
resp = client.get(testVideoTweet.replace("https://twitter.com","")+".mp4",headers={"User-Agent":"test"})
|
||||
assert resp.status_code==200
|
||||
assert videoVNF_compare["url"] in str(resp.data)
|
||||
|
||||
def test_message404():
|
||||
resp = client.get("https://twitter.com/jack/status/12345",headers={"User-Agent":"test"})
|
||||
assert resp.status_code==200
|
||||
assert msgs.tweetNotFound in str(resp.data)
|
Reference in New Issue
Block a user