def assert_has_extension(test, credential, name, value):
 expected = X509Extension(name, False, value)
 x509 = credential.certificate.original
 values = []
 for i in range(x509.get_extension_count()):
  extension = x509.get_extension(i)
  if (extension.get_short_name() == name):
   values.append(extension.get_data())
 test.assertIn(expected.get_data(), values)

def assert_has_extension ( test , credential , name , value ) : expected = X509Extension ( name , False , value ) x509 = credential . certificate . original values = [ ] for i in range ( x509 . get_extension_count ( ) ) : extension = x509 . get_extension ( i ) if ( extension . get_short_name ( ) == name ) : values . append ( extension . get_data ( ) ) test . assertIn ( expected . get_data ( ) , values )
assert that the x509extension with the matching name from the certificate has the given value .