forked from daisyUniverse/TwitFix
-
-
Notifications
You must be signed in to change notification settings - Fork 63
Expand file tree
/
Copy pathtest_vx_misc.py
More file actions
26 lines (23 loc) · 1.33 KB
/
test_vx_misc.py
File metadata and controls
26 lines (23 loc) · 1.33 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
import twitfix, cache, twExtract, utils
from vx_testdata import *
from twExtract import twUtils
def test_calcSyndicationToken():
assert twUtils.calcSyndicationToken("1691389765483200513") == "43lnobuxzql"
def test_stripEndTCO():
assert utils.stripEndTCO("Hello World https://t.co/abc123") == "Hello World"
assert utils.stripEndTCO("Hello\nWorld https://t.co/abc123") == "Hello\nWorld"
assert utils.stripEndTCO("Hello\nWorld\nhttps://t.co/abc123") == "Hello\nWorld"
assert utils.stripEndTCO("Hello\nWorld\n https://t.co/abc123") == "Hello\nWorld"
assert utils.stripEndTCO("Hello\nWorld \nhttps://t.co/abc123") == "Hello\nWorld"
def test_addToCache():
cache.clearCache()
twitfix.getTweetData(testTextTweet)
twitfix.getTweetData(testVideoTweet)
twitfix.getTweetData(testMediaTweet)
twitfix.getTweetData(testMultiMediaTweet)
#retrieve
compareDict(videoRedirect(testTextTweet_compare),videoRedirect(cache.getVnfFromLinkCache(testTextTweet)))
compareDict(videoRedirect(testVideoTweet_compare),videoRedirect(cache.getVnfFromLinkCache(testVideoTweet)))
compareDict(videoRedirect(testMediaTweet_compare),videoRedirect(cache.getVnfFromLinkCache(testMediaTweet)))
compareDict(videoRedirect(testMultiMediaTweet_compare),videoRedirect(cache.getVnfFromLinkCache(testMultiMediaTweet)))
cache.clearCache()