mirror of https://gitlab.com/bashrc2/epicyon
Test for rss hashtag extraction
parent
26f8c08c3f
commit
a4f9d57294
11
tests.py
11
tests.py
|
@ -84,6 +84,7 @@ from jsonldsig import testSignJsonld
|
||||||
from jsonldsig import jsonldVerify
|
from jsonldsig import jsonldVerify
|
||||||
from newsdaemon import hashtagRuleTree
|
from newsdaemon import hashtagRuleTree
|
||||||
from newsdaemon import hashtagRuleResolve
|
from newsdaemon import hashtagRuleResolve
|
||||||
|
from newswire import getNewswireTags
|
||||||
|
|
||||||
testServerAliceRunning = False
|
testServerAliceRunning = False
|
||||||
testServerBobRunning = False
|
testServerBobRunning = False
|
||||||
|
@ -2310,8 +2311,18 @@ def testHashtagRuleTree():
|
||||||
assert not hashtagRuleResolve(tree, hashtags, moderated, content, url)
|
assert not hashtagRuleResolve(tree, hashtags, moderated, content, url)
|
||||||
|
|
||||||
|
|
||||||
|
def testGetNewswireTags():
|
||||||
|
print('testGetNewswireTags')
|
||||||
|
rssDescription='<img src="https://somesite/someimage.jpg" class="misc-stuff" alt="#ExcitingHashtag" srcset="https://somesite/someimage.jpg" sizes="(max-width: 864px) 100vw, 864px" />Compelling description with #ExcitingHashtag, which is being posted in #BoringForum'
|
||||||
|
tags = getNewswireTags(rssDescription, 10)
|
||||||
|
assert len(tags) == 2
|
||||||
|
assert '#BoringForum' in tags
|
||||||
|
assert '#ExcitingHashtag' in tags
|
||||||
|
|
||||||
|
|
||||||
def runAllTests():
|
def runAllTests():
|
||||||
print('Running tests...')
|
print('Running tests...')
|
||||||
|
testGetNewswireTags()
|
||||||
testHashtagRuleTree()
|
testHashtagRuleTree()
|
||||||
testRemoveHtmlTag()
|
testRemoveHtmlTag()
|
||||||
testReplaceEmailQuote()
|
testReplaceEmailQuote()
|
||||||
|
|
Loading…
Reference in New Issue