def test_method_resolve_patched(self, Resolver): resolver = Resolver.return_value resolver.query.return_value = ['1.2.3.4'] dns = DnsUpdate('8.8.8.8', names, ipaddresses) ip = dns._resolve(4) ipaddress.ip_address(ip) self.assertEqual(ip, '1.2.3.4')
def test_method_resolve_unpatched(self): _names = copy.deepcopy(names) _names.zone_name = 'google.com.' dns = DnsUpdate('8.8.8.8', _names, ipaddresses) ip = dns._resolve(4) ipaddress.ip_address(ip)