forked from indymedia/epicyon
Extra test
parent
3419e0e17e
commit
c5b86c1b1d
9
tests.py
9
tests.py
|
@ -1557,19 +1557,28 @@ def testActorParsing():
|
||||||
|
|
||||||
def testWebLinks():
|
def testWebLinks():
|
||||||
print('testWebLinks')
|
print('testWebLinks')
|
||||||
|
|
||||||
exampleText='This post has a web links https://somesite.net\n\nAnd some other text'
|
exampleText='This post has a web links https://somesite.net\n\nAnd some other text'
|
||||||
linkedText=addWebLinks(exampleText)
|
linkedText=addWebLinks(exampleText)
|
||||||
assert '<a href="https://somesite.net" rel="nofollow noopener" target="_blank"><span class="invisible">https://</span><span class="ellipsis">somesite.net</span></a' in linkedText
|
assert '<a href="https://somesite.net" rel="nofollow noopener" target="_blank"><span class="invisible">https://</span><span class="ellipsis">somesite.net</span></a' in linkedText
|
||||||
|
|
||||||
exampleText='This post has a very long web link\n\nhttp://cbwebewuvfuftdiudbqd33dddbbyuef23fyug3bfhcyu2fct2cuyqbcbucuwvckiwyfgewfvqejbchevbhwevuevwbqebqekveqvuvjfkf.onion\n\nAnd some other text'
|
exampleText='This post has a very long web link\n\nhttp://cbwebewuvfuftdiudbqd33dddbbyuef23fyug3bfhcyu2fct2cuyqbcbucuwvckiwyfgewfvqejbchevbhwevuevwbqebqekveqvuvjfkf.onion\n\nAnd some other text'
|
||||||
linkedText=addWebLinks(exampleText)
|
linkedText=addWebLinks(exampleText)
|
||||||
assert 'ellipsis' in linkedText
|
assert 'ellipsis' in linkedText
|
||||||
|
|
||||||
exampleText='<p>1. HAHAHAHAHAHAHAHAHAHAHAHAHAHAHAHAHAHAHAHAHAHAHAHAHAHAHAHAHAHAHHAHAHAHAHAHAHAHAHAHAHAHAHHAHAHAHAHAHAHAHAH</p>'
|
exampleText='<p>1. HAHAHAHAHAHAHAHAHAHAHAHAHAHAHAHAHAHAHAHAHAHAHAHAHAHAHAHAHAHAHHAHAHAHAHAHAHAHAHAHAHAHAHHAHAHAHAHAHAHAHAH</p>'
|
||||||
resultText=removeLongWords(exampleText,40,[])
|
resultText=removeLongWords(exampleText,40,[])
|
||||||
assert resultText=='<p>1. HAHAHAHAHAHAHAHAHAHAHAHAHAHAHAHAHAHAHAHA</p>'
|
assert resultText=='<p>1. HAHAHAHAHAHAHAHAHAHAHAHAHAHAHAHAHAHAHAHA</p>'
|
||||||
|
|
||||||
exampleText='<p>ABCABCABCABCABCABCABCABCABCABCABCABCABCABCABCABCABCABCABCABCABCABCABCABCABCABCABCABCABCABCABCABCABCABCABCABCABCABCABCABCABCABCABCABCABCABCABCABCABCABCABCABCABCABCABCABCABCABCABCABCABCABCABCABCABCABCABCABCABCABCABCABCABCABCABCABCABCABCABCABCABCABCABCABCABCABCABCABCABCABCABCABCABCABCABCABCABCABCABCABCABCABCABCABCABCABCABCABCABCABCABCABCABCABCABCABCABCABCABCABCABCABCABCABCABCABCABCABCABCABCABCABCABCABCABCABCABCABCABCABCABCABCABCABCABCABCABCABCABCABCABCABCABCABCABCABCABCABCABCABCABCABCABCABCABCABCABCABCABCABC</p>'
|
exampleText='<p>ABCABCABCABCABCABCABCABCABCABCABCABCABCABCABCABCABCABCABCABCABCABCABCABCABCABCABCABCABCABCABCABCABCABCABCABCABCABCABCABCABCABCABCABCABCABCABCABCABCABCABCABCABCABCABCABCABCABCABCABCABCABCABCABCABCABCABCABCABCABCABCABCABCABCABCABCABCABCABCABCABCABCABCABCABCABCABCABCABCABCABCABCABCABCABCABCABCABCABCABCABCABCABCABCABCABCABCABCABCABCABCABCABCABCABCABCABCABCABCABCABCABCABCABCABCABCABCABCABCABCABCABCABCABCABCABCABCABCABCABCABCABCABCABCABCABCABCABCABCABCABCABCABCABCABCABCABCABCABCABCABCABCABCABCABCABCABCABCABCABC</p>'
|
||||||
resultText=removeLongWords(exampleText,40,[])
|
resultText=removeLongWords(exampleText,40,[])
|
||||||
assert resultText=='<p>ABCABCABCABCABCABCABCABCABCABCABCABCABCA<\p>'
|
assert resultText=='<p>ABCABCABCABCABCABCABCABCABCABCABCABCABCA<\p>'
|
||||||
|
|
||||||
|
exampleText='<p>Some text.\n\nHAHAHAHAHAHAHAHAHAHAHAHAHAHAHAHAHAHAHAHAHAHAHAHAHAHAHAHAHAHAHHAHAHAHAHAHAHAHAHAHAHAHAHHAHAHAHAHAHAHAHAH!</p>'
|
||||||
|
resultText=removeLongWords(exampleText,40,[])
|
||||||
|
assert resultText=='<p>Some text.\n\nHAHAHAHAHAHAHAHAHAHAHAHAHAHAHAHAH</p>'
|
||||||
|
|
||||||
|
|
||||||
def testAddEmoji():
|
def testAddEmoji():
|
||||||
print('testAddEmoji')
|
print('testAddEmoji')
|
||||||
content='Emoji :lemon: :strawberry: :banana:'
|
content='Emoji :lemon: :strawberry: :banana:'
|
||||||
|
|
Loading…
Reference in New Issue