packaging and testing

This commit is contained in:
Nikolaj Danger
2020-03-24 15:30:45 +01:00
parent de6ee115e7
commit 5394046aeb
10 changed files with 145 additions and 72 deletions

30
gwendolynTest.py Normal file
View File

@ -0,0 +1,30 @@
import unittest
import funcs
class testSwChar(unittest.TestCase):
def testNewChar(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 testDelChar(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!")
if __name__ == "__main__":
unittest.main()