Ejemplo n.º 1
0
def test_verify_signature_fail():
    with pytest.raises(WindowsError, match="The handle specified is invalid"):
        sspi.verify_signature(sspi.SecurityContext(), sspi.SecBufferDesc([]))
Ejemplo n.º 2
0
def test_query_context_attributes_invalid_handle(attribute):
    with pytest.raises(WindowsError, match="The handle specified is invalid"):
        sspi.query_context_attributes(sspi.SecurityContext(), attribute)
Ejemplo n.º 3
0
def test_query_context_attributes_unknown():
    with pytest.raises(
            NotImplementedError,
            match=
            "Only names, package_info, session_key, or sizes is implemented"):
        sspi.query_context_attributes(sspi.SecurityContext(), 1024)
Ejemplo n.º 4
0
def test_initialize_security_context_fail():
    with pytest.raises(WindowsError, match="The handle specified is invalid"):
        sspi.initialize_security_context(sspi.Credential(),
                                         sspi.SecurityContext(),
                                         u"target_name")
Ejemplo n.º 5
0
def test_encrypt_message_fail():
    with pytest.raises(WindowsError, match="The handle specified is invalid"):
        sspi.encrypt_message(sspi.SecurityContext(), sspi.SecBufferDesc([]))
Ejemplo n.º 6
0
def test_accept_security_context_fail():
    with pytest.raises(WindowsError, match="The handle specified is invalid"):
        sspi.accept_security_context(sspi.Credential(), sspi.SecurityContext(),
                                     sspi.SecBufferDesc([]))