Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import unittest
- from validator.ClientValidator import ClientValidator
- from repository.NoFilesRepo import NoFilesRepo
- from controller.ClientController import ClientController
- class Test(unittest.TestCase):
- def setUp(self):
- self.__cv = ClientValidator()
- self.__repo = NoFilesRepo()
- self.__cc = ClientController(self.__cv,self.__repo)
- def tearDown(self):
- del self.__cv
- del self.__cc
- del self.__repo
- def testClientController(self):
- cl = self.__cc.add_client("1", "Naruto", "1234567890123")
- assert (cl.ident == "1")
- assert (cl.name == "Naruto")
- assert (cl.cnp == "1234567890123")
- listcl = self.__cc.client_list()
- assert(len(listcl)==1)
- self.__cc.update_client("1", "", "1111111111111")
- assert (cl.ident == "1")
- assert (cl.name == "Naruto")
- assert (cl.cnp == "1111111111111")
- self.__cc.remove_client("1")
- listcl1 = self.__cc.client_list()
- assert(len(listcl1)==0)
- if __name__ == "__main__":
- #import sys;sys.argv = ['', 'Test.testName']
- unittest.main()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement