Пример #1
0
 def test_regex_with_over_255_characters_in_keypair_name(self):
     over_255_chars = ('abcdefghijklmnopqrstuvwzxyzabcdefghi\
         jklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvw\
         xyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijkl\
         mnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzab\
         cdefghijklmnopqrstuvwxyzcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstu\
         vwxyzabcde')
     response = check_keypair_regex(over_255_chars)    
     self.assertFalse(response, 
         'This should not have passed the regex rules as it exceeds 255 characters')
Пример #2
0
 def test_regex_with_invalid_character_in_keypair_name(self):
     response = check_keypair_regex('abc&123')
     self.assertFalse(response,
      'abc%123 should not have passed as it has an invalid character &')
Пример #3
0
 def test_regex_with_pem_extension(self):
     response = check_keypair_regex('ab12_AU12-Pb.pem')
     self.assertTrue(response, 
     'This should have passed as it contains all valid characters')
Пример #4
0
 def test_regex_with_zero_characters_keypair_name(self):
     zero_characters =('')
     response = check_keypair_regex(zero_characters)
     self.assertFalse(response,
     'This should not have passed as it contains zero characters keypairs must have at least 1 character')