<gh_stars>1-10
#!/usr/bin/env python3.6
import unittest # Importing the unittest module
from user import User # Importing the user class
from password import Password
import pyperclip

class TestPassword(unittest.TestCase):
    def setUp(self):
        self.new_profile = Password("Melissa", "Moringa", "10")
        self.new_user = User("Melissa","Malala","moringa") # create user object

    '''
    Test class that defines test cases for the profile behaviours.
    Args:
        unittest.TestCase: TestCase class that helps in creating test cases
    '''

    def tearDown(self):
            '''
            tearDown method that does clean up after each test case has run
            '''
            User.user_list = []
        # other test cases here

    def test_save_multiple_user(self):
            '''
            test_save_multiple_user to check if we can save multiple user
            objects to our user list
            '''
            self.new_user.save_user()
            test_user = User("Melissa", "Malala", "moringa")  # new user
            test_user.save_user()
            self.assertEqual(len(User.user_list), 2)

    def test_init(self):
        '''
        test_init test case to test if the object is initialized properly
        '''

        self.assertEqual(self.new_user.first_name,"Melissa")
        self.assertEqual(self.new_user.last_name,"Malala")
        self.assertEqual(self.new_user.password, "<PASSWORD>")

    def test_save_user(self):
        '''
        test_save_user test case to test if the user object is saved into
         the user list
        '''
        self.new_user.save_user()  # saving the new user
        self.assertEqual(len(User.user_list), 1)

    def test_delete_user(self):
        '''
        test_delete_user to test if we can remove a user from our user list
        '''
        self.new_user.save_user()
        test_user = User("Test", "user", "moringa")  # new user
        test_user.save_user()

        self.new_user.delete_user()  # Deleting a user object
        self.assertEqual(len(User.user_list), 1)


if __name__ == '__main__':
    unittest.main()
#!/usr/bin/env python3.6
import unittest # Importing the unittest module
from user import User # Importing the user class
from password import Password
import pyperclip

class TestPassword(unittest.TestCase):
    def setUp(self):
        self.new_profile = Password("Melissa", "Moringa", "10")
        self.new_user = User("Melissa","Malala","moringa") # create user object

    '''
    Test class that defines test cases for the profile behaviours.
    Args:
        unittest.TestCase: TestCase class that helps in creating test cases
    '''

    def tearDown(self):
            '''
            tearDown method that does clean up after each test case has run
            '''
            User.user_list = []
        # other test cases here

    def test_save_multiple_user(self):
            '''
            test_save_multiple_user to check if we can save multiple user
            objects to our user list
            '''
            self.new_user.save_user()
            test_user = User("Melissa", "Malala", "moringa")  # new user
            test_user.save_user()
            self.assertEqual(len(User.user_list), 2)

    def test_init(self):
        '''
        test_init test case to test if the object is initialized properly
        '''

        self.assertEqual(self.new_user.first_name,"Melissa")
        self.assertEqual(self.new_user.last_name,"Malala")
        self.assertEqual(self.new_user.password, "<PASSWORD>")

    def test_save_user(self):
        '''
        test_save_user test case to test if the user object is saved into
         the user list
        '''
        self.new_user.save_user()  # saving the new user
        self.assertEqual(len(User.user_list), 1)

    def test_delete_user(self):
        '''
        test_delete_user to test if we can remove a user from our user list
        '''
        self.new_user.save_user()
        test_user = User("Test", "user", "moringa")  # new user
        test_user.save_user()

        self.new_user.delete_user()  # Deleting a user object
        self.assertEqual(len(User.user_list), 1)


if __name__ == '__main__':
    unittest.main()
#!/usr/bin/env python3.6 # Importing the unittest module # Importing the user class # create user object Test class that defines test cases for the profile behaviours.     Args:         unittest.TestCase: TestCase class that helps in creating test cases tearDown method that does clean up after each test case has run # other test cases here test_save_multiple_user to check if we can save multiple user             objects to our user list # new user test_init test case to test if the object is initialized properly test_save_user test case to test if the user object is saved into          the user list # saving the new user test_delete_user to test if we can remove a user from our user list # new user # Deleting a user object