From 2f99631ed4025eb9265e93cd63f651fa6a6d2704 Mon Sep 17 00:00:00 2001 From: Shreya Date: Fri, 26 Feb 2021 22:39:32 +0530 Subject: [PATCH] Fix unit tests --- .../exploit/tests/zerologon_utils/test_vuln_assessment.py | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/monkey/infection_monkey/exploit/tests/zerologon_utils/test_vuln_assessment.py b/monkey/infection_monkey/exploit/tests/zerologon_utils/test_vuln_assessment.py index 7c833a67b..ca598ce7c 100644 --- a/monkey/infection_monkey/exploit/tests/zerologon_utils/test_vuln_assessment.py +++ b/monkey/infection_monkey/exploit/tests/zerologon_utils/test_vuln_assessment.py @@ -1,6 +1,7 @@ import pytest from nmb.NetBIOS import NetBIOS +from common.utils.exceptions import DomainControllerNameFetchError from infection_monkey.exploit.zerologon_utils.vuln_assessment import \ get_dc_details from infection_monkey.model.host import VictimHost @@ -38,8 +39,5 @@ def test_get_dc_details_no_netbios_names(host, monkeypatch): stub_queryIPForName = _get_stub_queryIPForName(NETBIOS_NAMES) monkeypatch.setattr(NetBIOS, "queryIPForName", stub_queryIPForName) - - dc_ip, dc_name, dc_handle = get_dc_details(host) - assert dc_ip == IP - assert dc_name == "" - assert dc_handle == "\\\\" + with pytest.raises(DomainControllerNameFetchError): + dc_ip, dc_name, dc_handle = get_dc_details(host)