def test_verify_signature_fail(): with pytest.raises(WindowsError, match="The handle specified is invalid"): sspi.verify_signature(sspi.SecurityContext(), sspi.SecBufferDesc([]))
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)
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)
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")
def test_encrypt_message_fail(): with pytest.raises(WindowsError, match="The handle specified is invalid"): sspi.encrypt_message(sspi.SecurityContext(), sspi.SecBufferDesc([]))
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([]))