Beispiel #1
0
    def test03_verify_min_length(self):
        """Verify minimum password length"""

        stdinvals = ['a', 'a', 'bb', 'bb', 'ccc', 'ccc', 'dddd', 'dddd']
        GppylibUserInputTestCase.mock_get_pass_start(stdinvals)

        result = ask_create_password(max_attempts=10, min_length=3)

        GppylibUserInputTestCase.mock_get_pass_stop()

        self.assertEquals(result, 'ccc')
Beispiel #2
0
    def test01_verify_too_short_password(self):
        """Verify non-matching password is rejected"""

        stdinvals = ['abcdef', 'ABCDEF', 'coolio', 'coolio']
        GppylibUserInputTestCase.mock_get_pass_start(stdinvals)

        result = ask_create_password()

        GppylibUserInputTestCase.mock_get_pass_stop()

        self.assertEquals(result, 'coolio')
Beispiel #3
0
    def test02_verify_max_attempts(self):
        """Verify max number of attempts to get password results in failure"""

        stdinvals = ['a', 'a', 'b', 'b', 'c', 'c', 'd', 'd']
        GppylibUserInputTestCase.mock_get_pass_start(stdinvals)

        result = ask_create_password(max_attempts=3)

        GppylibUserInputTestCase.mock_get_pass_stop()

        self.assertIsNone(result)
Beispiel #4
0
    def test00_verify_too_short_password(self):
        """Verify too short password is rejected"""

        stdinvals = ['abc', 'abc', 'foobar', 'foobar']
        GppylibUserInputTestCase.mock_get_pass_start(stdinvals)

        result = ask_create_password()

        GppylibUserInputTestCase.mock_get_pass_stop()

        self.assertEquals(result, 'foobar')