Merge branch 'master' of github.com:NikolajDanger/Gwendolyn

This commit is contained in:
NikolajDanger
2020-04-08 23:01:24 +02:00
2 changed files with 3 additions and 46 deletions

3
.gitignore vendored
View File

@ -146,8 +146,11 @@ cython_debug/
# static files generated from Django application using `collectstatic` # static files generated from Django application using `collectstatic`
media media
static static
.vscode/ .vscode/
token.txt token.txt
resources/swcharacters.json resources/swcharacters.json
resources/trivia.json resources/trivia.json
resources/destinyPoints.txt resources/destinyPoints.txt
gwendolynTest.py

View File

@ -1,46 +0,0 @@
import unittest
import funcs
class testSwChar(unittest.TestCase):
def test1NewChar(self):
text1, result = funcs.parseChar("TestUser","")
self.assertEqual(result,"Character for TestUser created")
def testChangeName(self):
text1, result = funcs.parseChar("TestUser","name TestChar")
self.assertEqual(result,"Changed TestChar's Name to TestChar")
def testChangeChar(self):
text1, result = funcs.parseChar("TestUser","characteristics brawn 1")
self.assertEqual(result,"Changed New Character's Characteristics")
def testXChar(self):
text1, result = funcs.parseChar("TestUser","Purge")
self.assertEqual(result,"Character for TestUser deleted")
class testGwendolynFuncs(unittest.TestCase):
def testCap(self):
self.assertEqual(funcs.cap("planet of the apes"),"Planet of the Apes")
self.assertEqual(funcs.cap("the greatest showman"),"The Greatest Showman")
self.assertEqual(funcs.cap("i'm the best person!"),"I'm the Best Person!")
def testWikiExists(self):
title, content, thumbnail = funcs.findWikiPage("Vivo")
self.assertEqual(title,"Vivo (Gud)")
self.assertEqual(content,"Vivo er den Phenolske gud for liv. Hun er en af de tre store guder der kom af at Unua splittede sig i 3.")
def testWikiDoesntExist(self):
title, content, thumbnail = funcs.findWikiPage("Big Butts")
self.assertEqual(title,"")
self.assertEqual(content,"Couldn't find page")
def testWikiImage(self):
title, content, thumbnail = funcs.findWikiPage("Moldaw")
self.assertEqual(title,"Moldaw Dragniel")
self.assertEqual(content,"Moldaw Dragniel (Født: Moldaw Geisler Dragniel) er en Rock Gnome fra den sydvestlige del af Zules Kongeriget i kejserriget Crozea. Han kommer fra den store landsby Ginti, hvor hans forældre arbejdede som håndværkere.")
self.assertEqual(thumbnail,"https://vignette.wikia.nocookie.net/senkulpa/images/9/9e/Moldaw.png/revision/latest?path-prefix=da")
if __name__ == "__main__":
unittest.main()