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