Added wiki command

This commit is contained in:
NikolajDanger
2020-04-03 15:57:28 +02:00
parent 69eb12f632
commit 25e7767c82
4 changed files with 54 additions and 4 deletions

View File

@@ -3,7 +3,7 @@ import unittest
import funcs
class testSwChar(unittest.TestCase):
def testNewChar(self):
def test1NewChar(self):
text1, result = funcs.parseChar("TestUser","")
self.assertEqual(result,"Character for TestUser created")
@@ -15,8 +15,8 @@ class testSwChar(unittest.TestCase):
text1, result = funcs.parseChar("TestUser","characteristics brawn 1")
self.assertEqual(result,"Changed New Character's Characteristics")
def testDelChar(self):
text1, result = funcs.parseChar("TestUser","purge")
def testXChar(self):
text1, result = funcs.parseChar("TestUser","Purge")
self.assertEqual(result,"Character for TestUser deleted")
@@ -26,5 +26,21 @@ class testGwendolynFuncs(unittest.TestCase):
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")
if __name__ == "__main__":
unittest.main()