Пример #1
0
    def test_get_creds(self):
        # Get unencrypted credentials
        with mock.patch('__builtin__.raw_input', return_value='testCred'):
            creds = romcreds.getcreds()

        # Test the credentials
        self.check_creds(creds)
Пример #2
0
    def test_enc_creds(self):
        # Get unencrypted credentials
        with mock.patch('__builtin__.raw_input', return_value='testCred'):
            creds = romcreds.getcreds()

        # Test the credentials
        self.check_creds(creds)

        # Encrypt and then immediately decrypt credentials
        with mock.patch('getpass.getpass', return_value=''):
            enc = romcreds.encryptcreds(creds)
            dec = romcreds.decryptcreds(enc)

        # Test the credentials again
        self.check_creds(dec)