Exemple #1
0
    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)
Exemple #2
0
    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)

        assert result is None