def test_zone_transfer_form_error(self): address = 'test' domain = dns.name.from_text('example.com.') with unittest.mock.patch.object(fierce.dns.zone, 'from_xfr', side_effect=dns.exception.FormError()): result = fierce.zone_transfer(address, domain) self.assertIsNone(result)
def test_zone_transfer_timeout_error(self): address = 'test' domain = dns.name.from_text('example.com.') with unittest.mock.patch.object(fierce.dns.zone, 'from_xfr', side_effect=TimeoutError()): result = fierce.zone_transfer(address, domain) self.assertIs(result, None)