From ceb4dded57692b1bfc205de08bab2122ff037ed7 Mon Sep 17 00:00:00 2001 From: NikolajDanger Date: Wed, 8 Apr 2020 22:08:16 +0200 Subject: [PATCH] =?UTF-8?q?Revert=20"=F0=9F=90=8D=20UnitTests=20added=20to?= =?UTF-8?q?=20gitignore"?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit 9b4d10dca207156fd4a557bd3061b28ce90613bd. --- gwendolynTest.py | 46 ++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 46 insertions(+) create mode 100644 gwendolynTest.py diff --git a/gwendolynTest.py b/gwendolynTest.py new file mode 100644 index 0000000..43fe87d --- /dev/null +++ b/gwendolynTest.py @@ -0,0 +1,46 @@ +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() \ No newline at end of file