Exemplo n.º 1
0
    def test_copy_password(self):
        '''
        Testing if the copy password function works
        '''
        self.new_data.add_password()
        UsersData.copy_password(1, 1)

        self.assertEqual(self.new_data.web_key, pyperclip.paste())
Exemplo n.º 2
0
    def test_data_exists(self):

        self.new_data.add_password()
        test_data = UsersData(1, 1, "twitter.com", "programmer")
        test_data.add_password()

        data_exists = UsersData.existing_data(1)
        self.assertTrue(data_exists)
Exemplo n.º 3
0
    def test_display_data(self):

        self.new_data.add_password()
        test_data = UsersData(1, 1, "twitter.com", "programmer")
        test_data.add_password()

        data_found = UsersData.display_data(1, 1)
        self.assertEqual(data_found.website, test_data.website)
Exemplo n.º 4
0
    def test_display_data(self):
        '''
        Testing if the data can be displayed.
        '''
        self.new_data.add_password()
        test_data = UsersData(1, 1, "facebook.com", "tesla", "musky")
        test_data.add_password()

        data_found = UsersData.display_data(1, 1)
        self.assertEqual(data_found.website, test_data.website)
Exemplo n.º 5
0
    def test_data_exists(self):
        '''
        Testing to check if the function for checking data works well
        '''
        self.new_data.add_password()
        test_data = UsersData(1, 1, "facebook.com", "musky", "tesla")
        test_data.add_password()

        data_exists = UsersData.existing_data(1)
        self.assertTrue(data_exists)
Exemplo n.º 6
0
class TestUserData(unittest.TestCase):
    def setUp(self):

        self.new_data = UsersData(1, 1, "twitter.com", "programmer")

    def tearDown(self):

        UsersData.data_list = []

    def test_init(self):

        self.assertEqual(self.new_data.ident, 1)
        self.assertEqual(self.new_data.data_id, 1)
        self.assertEqual(self.new_data.website, "twitter.com")
        self.assertEqual(self.new_data.web_key, "programmer")

    def test_add_password(self):

        self.new_data.add_password()
        self.assertEqual(len(UsersData.data_list), 1)

    def test_display_data(self):

        self.new_data.add_password()
        test_data = UsersData(1, 1, "twitter.com", "programmer")
        test_data.add_password()

        data_found = UsersData.display_data(1, 1)
        self.assertEqual(data_found.website, test_data.website)

    def test_data_exists(self):

        self.new_data.add_password()
        test_data = UsersData(1, 1, "twitter.com", "programmer")
        test_data.add_password()

        data_exists = UsersData.existing_data(1)
        self.assertTrue(data_exists)

    def test_copy_password(self):

        self.new_data.add_password()
        UsersData.copy_password(1, 1)

        self.assertEqual(self.new_data.web_key, pyperclip.paste())
Exemplo n.º 7
0
 def setUp(self):
     '''
     Setting up the structure before each test
     '''
     self.new_data = UsersData(1, 1, "facebook.com", "musky", "tesla")
Exemplo n.º 8
0
class TestUserData(unittest.TestCase):
    '''
    Test class that defines the test cases for creating websites log in credentials
    '''
    def setUp(self):
        '''
        Setting up the structure before each test
        '''
        self.new_data = UsersData(1, 1, "facebook.com", "musky", "tesla")

    def tearDown(self):
        '''
        Cleans up the test after test is complete
        '''
        UsersData.data_list = []

    def test_init(self):
        '''
        Test case to evaluate if the case has been initialized properly
        '''
        self.assertEqual(self.new_data.ident, 1)
        self.assertEqual(self.new_data.data_id, 1)
        self.assertEqual(self.new_data.website, "facebook.com")
        self.assertEqual(self.new_data.web_key, "musky")
        self.assertEqual(self.new_data.name, "tesla")

    def test_add_password(self):
        '''
        Testing if the new website and password can be saved
        '''
        self.new_data.add_password()
        self.assertEqual(len(UsersData.data_list), 1)

    def test_display_data(self):
        '''
        Testing if the data can be displayed.
        '''
        self.new_data.add_password()
        test_data = UsersData(1, 1, "facebook.com", "tesla", "musky")
        test_data.add_password()

        data_found = UsersData.display_data(1, 1)
        self.assertEqual(data_found.website, test_data.website)

    def test_data_exists(self):
        '''
        Testing to check if the function for checking data works well
        '''
        self.new_data.add_password()
        test_data = UsersData(1, 1, "facebook.com", "musky", "tesla")
        test_data.add_password()

        data_exists = UsersData.existing_data(1)
        self.assertTrue(data_exists)

    def test_copy_password(self):
        '''
        Testing if the copy password function works
        '''
        self.new_data.add_password()
        UsersData.copy_password(1, 1)

        self.assertEqual(self.new_data.web_key, pyperclip.paste())
Exemplo n.º 9
0
def copy_password(number, count):
    '''
    Function that copies the password to the clipboard
    '''
    UsersData.copy_password(number, count)
Exemplo n.º 10
0
def data_existing(data):
    '''
    Function that checks if user data exists
    '''
    return UsersData.existing_data(data)
Exemplo n.º 11
0
def display_data(data, number):
    '''
    Function that displays the user data
    '''
    return UsersData.display_data(data, number)
Exemplo n.º 12
0
def display_data(data, number):

    return UsersData.display_data(data, number)
Exemplo n.º 13
0
    def test_copy_password(self):

        self.new_data.add_password()
        UsersData.copy_password(1, 1)

        self.assertEqual(self.new_data.web_key, pyperclip.paste())
Exemplo n.º 14
0
    def setUp(self):

        self.new_data = UsersData(1, 1, "twitter.com", "programmer")
Exemplo n.º 15
0
def copy_password(number, count):

    UsersData.copy_password(number, count)
Exemplo n.º 16
0
def data_existing(data):

    return UsersData.existing_data(data)
Exemplo n.º 17
0
def my_new_data(user_id, data_id, website, web_key):
    '''
    Function that creates new data for storing password
    '''
    new_data = UsersData(user_id, data_id, website, web_key)
    return new_data
Exemplo n.º 18
0
def my_new_data(user_id, data_id, website, web_key):

    new_data = UsersData(user_id, data_id, website, web_key)
    return new_data