Esempio n. 1
0
 def test_username_in_upn_form(self):
     actual = NtlmContext("*****@*****.**", "password")
     assert actual.domain == ""
     assert actual.username == "*****@*****.**"
Esempio n. 2
0
 def test_username_without_domain(self):
     actual = NtlmContext("username", "password")
     assert actual.domain == ""
     assert actual.username == "username"
Esempio n. 3
0
 def test_username_in_netlogon_form(self):
     actual = NtlmContext("DOMAIN\\username", "password")
     assert actual.domain == "DOMAIN"
     assert actual.username == "username"
Esempio n. 4
0
 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"