class TestUser(unittest.TestCase): def setUp(self): self.newlogin = Credentials("devgakuya", "qwerty", "DevPass") def test_init(self): self.assertEqual(self.newlogin.username, "devgakuya") self.assertEqual(self.newlogin.password, "qwerty") self.assertEqual(self.newlogin.account_type, "DevPass") def test_save_account(self): self.newlogin.save_account() self.assertEqual(len(Credentials.user_details_list), 1) def tearDown(self): Credentials.user_details_list = [] def test_user_account_exits(self): self.newlogin.save_user_account() test_user = Credentials("username", "password", "accountType") test_user.save_user_account() user_account_exists = Credentials.user_account_exists("username") self.assertEqual(user_account_exists) def test_display_user_acounts(self): self.assertEqual(Credentials.display_user_accounts(), Credentials.user_details_list) def test_delete_acc(self): self.newlogin.save_user_account() test_user = Credentials("username", "password", "accountType") test_user.save_user_account() self.newlogin.delete_acc() self.assertEqual(len(Credentials.user_details_list), 1)
def test_delete_acc(self): self.newlogin.save_user_account() test_user = Credentials("username", "password", "accountType") test_user.save_user_account() self.newlogin.delete_acc() self.assertEqual(len(Credentials.user_details_list), 1)
def test_delete_user_account(self): self.newlogin.save_user_account() test_user = Credentials("namesusing","passusing","accountusing") test_user.save_user_account() self.newlogin.delete_user_account() self.assertEqual(len(Credentials.userLogin_list),1)
class TestUser(unittest.TestCase): def setUp(self): self.newlogin = Credentials("kaphie","2000","putlocker") def test_init(self): self.assertEqual(self.newlogin.username,"kaphie") self.assertEqual(self.newlogin.password,"2000") self.assertEqual(self.newlogin.accountType,"putlocker") def test_save_user_account(self): self.newlogin.save_user_account() self.assertEqual(len(Credentials.userLogin_list),1) def tearDown(self): Credentials.userLogin_list = [] def test_save_multiple_user_accounts(self): self.newlogin.save_user_account() test_user = Credentials("namesusing","passusing","accountusing") test_user.save_user_account() self.assertEqual(len(Credentials.userLogin_list),2) def test_user_accounts_exist(self): self.newlogin.save_user_account() test_user = Credentials("namesusing","passusing","accountusing") test_user.save_user_account() user_account_exists = Credentials.user_account_exists("namesusing") self.assertTrue(user_account_exists) def test_display_users_acounts(self): self.assertEqual(Credentials.display_user_accounts(),Credentials.userLogin_list) def test_delete_user_account(self): self.newlogin.save_user_account() test_user = Credentials("namesusing","passusing","accountusing") test_user.save_user_account() self.newlogin.delete_user_account() self.assertEqual(len(Credentials.userLogin_list),1)
def test_user_account_exits(self): self.newlogin.save_user_account() test_user = Credentials("username", "password", "accountType") test_user.save_user_account() user_account_exists = Credentials.user_account_exists("username") self.assertEqual(user_account_exists)
def test_user_accounts_exist(self): self.newlogin.save_user_account() test_user = Credentials("namesusing","passusing","accountusing") test_user.save_user_account() user_account_exists = Credentials.user_account_exists("namesusing") self.assertTrue(user_account_exists)