forked from indymedia/epicyon
Unit test for valid nickname
parent
ca94076cf4
commit
5d2b45560e
19
tests.py
19
tests.py
|
@ -32,6 +32,7 @@ from follow import clearFollows
|
|||
from follow import clearFollowers
|
||||
from follow import sendFollowRequestViaServer
|
||||
from follow import sendUnfollowRequestViaServer
|
||||
from utils import validNickname
|
||||
from utils import firstParagraphFromString
|
||||
from utils import removeIdEnding
|
||||
from utils import siteIsActive
|
||||
|
@ -2403,8 +2404,26 @@ def testParseFeedDate():
|
|||
assert publishedDate == "2020-11-22 18:51:33+00:00"
|
||||
|
||||
|
||||
def testValidNickname():
|
||||
print('testValidNickname')
|
||||
domain = 'somedomain.net'
|
||||
|
||||
nickname = 'myvalidnick'
|
||||
assert validNickname(domain, nickname)
|
||||
|
||||
nickname = 'my.invalid.nick'
|
||||
assert not validNickname(domain, nickname)
|
||||
|
||||
nickname = 'myinvalidnick?'
|
||||
assert not validNickname(domain, nickname)
|
||||
|
||||
nickname = 'my invalid nick?'
|
||||
assert not validNickname(domain, nickname)
|
||||
|
||||
|
||||
def runAllTests():
|
||||
print('Running tests...')
|
||||
testValidNickname()
|
||||
testParseFeedDate()
|
||||
testFirstParagraphFromString()
|
||||
testGetNewswireTags()
|
||||
|
|
Loading…
Reference in New Issue