Beispiel #1
0
 def test_invalid(self):
     """
     Test case for an invalid file type.
     """
     mock_fieldfile = Mock()
     mock_fieldfile.name = 'bad_file_name.pem.jar'
     with self.assertRaises(ValidationError):
         key_file_validator(mock_fieldfile)
Beispiel #2
0
 def test_pub(self):
     """
     Test case for a .pub file.
     """
     mock_fieldfile = Mock()
     mock_fieldfile.name = 'good_file_name.pem'
     try:
         key_file_validator(mock_fieldfile)
     except ValidationError:
         self.fail('Field name raised ValidationError unexpectedly')