def testGetV3ExtensionFieldsFromSequenceWhenOIDKeyUsage(self):
    self.mox.StubOutWithMock(x509.der_decoder, 'decode', True)
    e_key_usage = univ.OctetString('\x03e_key_usage')
    d_key_usage = ((1, 0, 1),)

    x509.der_decoder.decode(e_key_usage).AndReturn(d_key_usage)

    seq = (
      ('junk', ('value', 'value')),
      (x509.OID_X509V3_KEY_USAGE, e_key_usage),
    )

    output = {
        'key_usage': (
            x509.X509V3_KEY_USAGE_BIT_FIELDS[0],
            x509.X509V3_KEY_USAGE_BIT_FIELDS[2],
            ),
    }

    self.mox.ReplayAll()
    self.assertEqual(
        output,
        self.x._GetV3ExtensionFieldsFromSequence(seq))
    self.mox.VerifyAll()
Creates kernel/ramdisk file from the image stored in the cache.
dataset/ETHPy150Open google/simian/src/tests/simian/auth/x509_test.py/X509CertificateTest.testGetV3ExtensionFieldsFromSequenceWhenOIDKeyUsage--crossover with--dataset/ETHPy150Open BU-NU-CLOUD-SP16/Trusted-Platform-Module-nova/nova/virt/xenapi/vm_utils.py/_create_kernel_image