':py:obj:`X509.get_extension_count` returns the number of extensions that are
present in the certificate.'

def test_extension_count(self):

    pkey = load_privatekey(FILETYPE_PEM, client_key_pem)
    ca = X509Extension(b('basicConstraints'), True, b('CA:FALSE'))
    key = X509Extension(b('keyUsage'), True, b('digitalSignature'))
    subjectAltName = X509Extension(b('subjectAltName'), True, b('DNS:example.com'))
    c = self._extcert(pkey, [])
    self.assertEqual(c.get_extension_count(), 0)
    c = self._extcert(pkey, [ca])
    self.assertEqual(c.get_extension_count(), 1)
    c = self._extcert(pkey, [ca, key, subjectAltName])
    self.assertEqual(c.get_extension_count(), 3)
