def test_evaluatePasswordDictionary_mixedcase(self): password = "******" mocked_open = mock_open(read_data='abc \n def \n hij \n klm \n opq') with patch('derivatex.robustness.open', mocked_open, create=True): password_without_words, possible_combinations = robustness.evaluatePasswordDictionary( password) self.assertEqual(password_without_words, "z2vbhhd1l**c", "Word was not removed from password") self.assertEqual(possible_combinations, pow(pow(2, 3) * 5, 2), "Number of combinations is wrong")
def test_evaluatePasswordDictionary_empty(self): password = "" mocked_open = mock_open(read_data='abc \n def \n hij \n klm \n opq') with patch('derivatex.robustness.open', mocked_open, create=True): password_without_words, possible_combinations = robustness.evaluatePasswordDictionary( password) self.assertEqual(password_without_words, "", "Word was not removed from password") self.assertEqual(possible_combinations, 0, "Number of combinations is wrong")