Esempio n. 1
0
 def test_delete_acc(self):
     """
     Created test to delete account credentials 
     """
     self.new_acc.save_acc()
     test_acc3 = AccountDetails("hannes", "Reddit", "yoda")
     test_acc3.save_acc()
     
     test_acc3.delete_acc()
     self.assertEqual(len(AccountDetails.details_list),1)
Esempio n. 2
0
 def test_find_creds(self):
     """
     Created test to find a users credentials
     """
     self.new_acc.save_acc()
     testacc4 = AccountDetails("peter123", "Gmail", "qwert123")
     testacc4.save_acc()
     
     found_creds = AccountDetails.find_creds("peter123")
     self.assertEqual(found_creds.acc_username,testacc4.acc_username)
Esempio n. 3
0
    def test_save_multiple_acc(self):
        """
        Created test to save save multiple account to the list in a clasS AccountDetails
        """
        self.new_acc.save_acc()
        test_acc= AccountDetails("samuel123","Facebook", "samuel@123" )
        test_acc.save_acc()

        test_acc2 = AccountDetails("alvin.kyle", "Instagram", "kyle@abc")
        test_acc2.save_acc()
        self.assertEqual(len(AccountDetails.details_list), 3)
Esempio n. 4
0
class TestAccountDetails(unittest.TestCase):
    
    def setUp(self):
        """
        Set Up with dummy instance object of Account Details 
        """
        self.new_acc = AccountDetails("Sydx10", "Snapchat", "syd123")
    
    def tearDown(self):
        """
        
        """
        AccountDetails.details_list= []

    def test__init__(self):
        """
        Created test to check if the object has actually been instansiated 
        """
        self.assertEqual(self.new_acc.acc_username,"Sydx10")
        self.assertEqual(self.new_acc.platform_name, "Snapchat")
        self.assertEqual(self.new_acc.acc_password, "syd123")
    
    def test_save_acc(self):
        """
        Created test to check if object of Account Details is being added to a list
        """
        self.new_acc.save_acc()
        self.assertEqual(len(AccountDetails.details_list), 1)

    def test_save_multiple_acc(self):
        """
        Created test to save save multiple account to the list in a clasS AccountDetails
        """
        self.new_acc.save_acc()
        test_acc= AccountDetails("samuel123","Facebook", "samuel@123" )
        test_acc.save_acc()

        test_acc2 = AccountDetails("alvin.kyle", "Instagram", "kyle@abc")
        test_acc2.save_acc()
        self.assertEqual(len(AccountDetails.details_list), 3)

    def test_delete_acc(self):
        """
        Created test to delete account credentials 
        """
        self.new_acc.save_acc()
        test_acc3 = AccountDetails("hannes", "Reddit", "yoda")
        test_acc3.save_acc()
        
        test_acc3.delete_acc()
        self.assertEqual(len(AccountDetails.details_list),1)
    
    def test_display_accs(self):
        """
        Created test to display all account credentials for user
        """
        self.assertEqual(AccountDetails.display_accs(), AccountDetails.details_list)

    def test_find_creds(self):
        """
        Created test to find a users credentials
        """
        self.new_acc.save_acc()
        testacc4 = AccountDetails("peter123", "Gmail", "qwert123")
        testacc4.save_acc()
        
        found_creds = AccountDetails.find_creds("peter123")
        self.assertEqual(found_creds.acc_username,testacc4.acc_username)