예제 #1
0
 def test_unknown(self):
     field = 'ABC'
     with self.assertRaisesRegex(ValueError,
                                 '^Unknown x509 name field: ABC$') as e:
         parse_name('/%s=example.com' % field)
     self.assertEqual(e.exception.args,
                      ('Unknown x509 name field: %s' % field, ))
예제 #2
0
파일: base.py 프로젝트: redNixon/django-ca
 def __call__(self, parser, namespace, value, option_string=None):
     try:
         value = parse_name(value)
     except ValueError as e:
         parser.error(e)
     setattr(namespace, self.dest, value)
예제 #3
0
 def assertSubject(self, actual, expected):
     self.assertEqual(list(parse_name(actual).items()), expected)