Exemplo n.º 1
0
 def test_long_crack_password(self):
     m = mellt.Mellt()
     password = '******'  # https://xkcd.com/936/
     self.assertEquals(1000000000, m.check_password(password))
Exemplo n.º 2
0
 def test_check_common_password(self):
     m = mellt.Mellt()
     password = '******'
     self.assertEquals(-1, m.check_password(password))
Exemplo n.º 3
0
 def test_two_day_password(self):
     m = mellt.Mellt()
     password = '******'
     self.assertEquals(2, m.check_password(password))
Exemplo n.º 4
0
 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))
Exemplo n.º 5
0
 def test_check_empty_password(self):
     m = mellt.Mellt()
     password = ''
     self.assertEquals(-1, m.check_password(password))
Exemplo n.º 6
0
 def test_char_set_single_number(self):
     m = mellt.Mellt()
     password = '******'
     self.assertEqual('0123456789', m._Mellt__get_char_set(password))
Exemplo n.º 7
0
 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))
Exemplo n.º 8
0
 def test_last_common(self):
     m = mellt.Mellt()
     password = '******'
     self.assertTrue(m._Mellt__check_common(password))
Exemplo n.º 9
0
 def test_not_common(self):
     m = mellt.Mellt()
     password = '******'
     self.assertFalse(m._Mellt__check_common(password))
Exemplo n.º 10
0
 def test_char_set_multiple_extra_funny_characters(self):
     m = mellt.Mellt()
     password = '******'
     self.assertEqual("abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()-=_+[]\"{}|;':,./<>?`~", m._Mellt__get_char_set(password))
Exemplo n.º 11
0
 def test_first_common(self):
     m = mellt.Mellt()
     password = '******'
     self.assertTrue(m._Mellt__check_common(password))
Exemplo n.º 12
0
 def test_char_set_multiple_funny_characters(self):
     m = mellt.Mellt()
     password = '******'
     self.assertEqual("abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()-=_+", m._Mellt__get_char_set(password))
Exemplo n.º 13
0
 def test_char_set_alphanum_numbers(self):
     m = mellt.Mellt()
     password = '******'
     self.assertEqual('abcdefghijklmnopqrstuvwxyz0123456789', m._Mellt__get_char_set(password))
Exemplo n.º 14
0
 def test_char_set_multiple_numbers(self):
     m = mellt.Mellt()
     password = '******'
     self.assertEqual('0123456789', m._Mellt__get_char_set(password))
Exemplo n.º 15
0
 def test_char_set_single_extra_funny_character(self):
     m = mellt.Mellt()
     password = '******'
     self.assertEqual("abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()-=_+[]\"{}|;':,./<>?`~", m._Mellt__get_char_set(password))
Exemplo n.º 16
0
 def test_char_set_single_letter(self):
     m = mellt.Mellt()
     password = '******'
     self.assertEqual('abcdefghijklmnopqrstuvwxyz', m._Mellt__get_char_set(password))