def test_long_crack_password(self): m = mellt.Mellt() password = '******' # https://xkcd.com/936/ self.assertEquals(1000000000, m.check_password(password))
def test_check_common_password(self): m = mellt.Mellt() password = '******' self.assertEquals(-1, m.check_password(password))
def test_two_day_password(self): m = mellt.Mellt() password = '******' self.assertEquals(2, m.check_password(password))
def test_max_brute_force_common(self): m = mellt.Mellt() password = '******' #value taken from the php version self.assertEquals(1000000000, m._Mellt__brute_force_days(password))
def test_check_empty_password(self): m = mellt.Mellt() password = '' self.assertEquals(-1, m.check_password(password))
def test_char_set_single_number(self): m = mellt.Mellt() password = '******' self.assertEqual('0123456789', m._Mellt__get_char_set(password))
def test_short_brute_force(self): m = mellt.Mellt() password = '******' #value taken from the php version self.assertEquals(2, m._Mellt__brute_force_days(password))
def test_last_common(self): m = mellt.Mellt() password = '******' self.assertTrue(m._Mellt__check_common(password))
def test_not_common(self): m = mellt.Mellt() password = '******' self.assertFalse(m._Mellt__check_common(password))
def test_char_set_multiple_extra_funny_characters(self): m = mellt.Mellt() password = '******' self.assertEqual("abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()-=_+[]\"{}|;':,./<>?`~", m._Mellt__get_char_set(password))
def test_first_common(self): m = mellt.Mellt() password = '******' self.assertTrue(m._Mellt__check_common(password))
def test_char_set_multiple_funny_characters(self): m = mellt.Mellt() password = '******' self.assertEqual("abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()-=_+", m._Mellt__get_char_set(password))
def test_char_set_alphanum_numbers(self): m = mellt.Mellt() password = '******' self.assertEqual('abcdefghijklmnopqrstuvwxyz0123456789', m._Mellt__get_char_set(password))
def test_char_set_multiple_numbers(self): m = mellt.Mellt() password = '******' self.assertEqual('0123456789', m._Mellt__get_char_set(password))
def test_char_set_single_extra_funny_character(self): m = mellt.Mellt() password = '******' self.assertEqual("abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()-=_+[]\"{}|;':,./<>?`~", m._Mellt__get_char_set(password))
def test_char_set_single_letter(self): m = mellt.Mellt() password = '******' self.assertEqual('abcdefghijklmnopqrstuvwxyz', m._Mellt__get_char_set(password))