<gh_stars>0
import unittest # Importing the unittest module
from user import User
from credential import Credential
import pyperclip


class TestUser(unittest.TestCase):
    
    '''
    A test class that defines test cases for the user class behaviours.

    Args:
        unittest.TestCase: TestCase class that helps in creating test cases
    '''
    
    def setUp(self):
        '''
        A set up method to run before each test cases.
        '''
        self.new_user = User('SophieCee','<PASSWORD>!')
        
    
    def tearDown(self):
        '''
        The tearDown method that does the clean up after each test case has run.
        '''
        User.user_list= []
        
    def test_init(self):
        '''
        The test_init test case to test if the object is initialized properly
        '''
        self.assertEqual(self.new_user.username,'SophieCee')  
        self.assertEqual(self.new_user.password,'<PASSWORD>!')  
        
    def test_save_user(self):
        '''
        The test_save_user to check whether we can save our user objects to our users_list
        '''
        self.new_user.save_user()
        self.assertEqual(len(User.user_list),1)
        
        

if __name__ == '__main__':
    unittest.main()            
        
    
        
        
        
        
    
    


import unittest # Importing the unittest module
from user import User
from credential import Credential
import pyperclip


class TestUser(unittest.TestCase):
    
    '''
    A test class that defines test cases for the user class behaviours.

    Args:
        unittest.TestCase: TestCase class that helps in creating test cases
    '''
    
    def setUp(self):
        '''
        A set up method to run before each test cases.
        '''
        self.new_user = User('SophieCee','<PASSWORD>!')
        
    
    def tearDown(self):
        '''
        The tearDown method that does the clean up after each test case has run.
        '''
        User.user_list= []
        
    def test_init(self):
        '''
        The test_init test case to test if the object is initialized properly
        '''
        self.assertEqual(self.new_user.username,'SophieCee')  
        self.assertEqual(self.new_user.password,'<PASSWORD>!')  
        
    def test_save_user(self):
        '''
        The test_save_user to check whether we can save our user objects to our users_list
        '''
        self.new_user.save_user()
        self.assertEqual(len(User.user_list),1)
        
        

if __name__ == '__main__':
    unittest.main()
# Importing the unittest module A test class that defines test cases for the user class behaviours.      Args:         unittest.TestCase: TestCase class that helps in creating test cases A set up method to run before each test cases. The tearDown method that does the clean up after each test case has run. The test_init test case to test if the object is initialized properly The test_save_user to check whether we can save our user objects to our users_list