def test_ne(self, backend): sct1 = (_load_data( os.path.join("x509", "ocsp", "resp-sct-extension.der"), ocsp.load_der_ocsp_response, ).single_extensions.get_extension_for_class( x509.SignedCertificateTimestamps).value) sct2 = x509.SignedCertificateTimestamps([]) assert sct1 != sct2 assert sct1 != object()
def test_hash(self, backend): sct1 = _load_data( os.path.join("x509", "ocsp", "resp-sct-extension.der"), ocsp.load_der_ocsp_response, ).single_extensions.get_extension_for_class( x509.SignedCertificateTimestamps ).value sct2 = _load_data( os.path.join("x509", "ocsp", "resp-sct-extension.der"), ocsp.load_der_ocsp_response, ).single_extensions.get_extension_for_class( x509.SignedCertificateTimestamps ).value sct3 = x509.SignedCertificateTimestamps([]) assert hash(sct1) == hash(sct2) assert hash(sct1) != hash(sct3)
def test_repr(self): assert repr(x509.SignedCertificateTimestamps( [])) == ("<SignedCertificateTimestamps([])>")
def test_init(self): with pytest.raises(TypeError): x509.SignedCertificateTimestamps([object()])
def _decode_signed_certificate_timestamps(backend, asn1_scts): return x509.SignedCertificateTimestamps(_decode_scts(backend, asn1_scts))
def test_init(self): with pytest.raises(TypeError): x509.SignedCertificateTimestamps( [object()] # type: ignore[list-item] )