def test_username_in_upn_form(self): actual = NtlmContext("*****@*****.**", "password") assert actual.domain == "" assert actual.username == "*****@*****.**"
def test_username_without_domain(self): actual = NtlmContext("username", "password") assert actual.domain == "" assert actual.username == "username"
def test_username_in_netlogon_form(self): actual = NtlmContext("DOMAIN\\username", "password") assert actual.domain == "DOMAIN" assert actual.username == "username"
def test_no_password_fail(self): with pytest.raises(SMBException) as exc: NtlmContext("username", None) assert str(exc.value) == "The password must be set when using NTLM " \ "authentication"