def test_delete_user(self): self.new_user.save_new_user() test_user = User("Rovine", 2345) test_user.save_new_user() self.new_user.delete_user() self.assertEqual(len(User.User_List),1)
class TestUser(unittest.TestCase): def setUp(self): self.new_user = User("Wanjala", 12345) def test_init(self): self.assertEqual(self.new_user.username,"Wanjala") self.assertEqual(self.new_user.password,12345) def test_save_user(self): self.new_user.save_new_user() self.assertEqual(len(User.User_List),1) def test_save_multiple_user(self): self.new_user.save_new_user() second_user = User("Rovine",2345) second_user.save_new_user() self.assertEqual(len(User.User_List),2) def tearDown (second_user): User.User_List = [] def test_display_all_users(self): self.assertEqual(User.display_users(),User.User_List) def test_delete_user(self): self.new_user.save_new_user() test_user = User("Rovine", 2345) test_user.save_new_user() self.new_user.delete_user() self.assertEqual(len(User.User_List),1)
def test_save_multiple_user(self): self.new_user.save_new_user() second_user = User("Rovine",2345) second_user.save_new_user() self.assertEqual(len(User.User_List),2)