Example #1
0
    def test_get_host(self):
        ips = [
            '74.125.225.229',  # ARIN
            '2001:4860:4860::8888'
        ]

        for ip in ips:
            result = Net(ip)
            try:
                self.assertIsInstance(result.get_host(0), tuple)
            except HostLookupError:
                pass
            except AssertionError as e:
                raise e
            except Exception as e:
                self.fail('Unexpected exception raised: {0}'.format(e))

        result = Net('74.125.225.229', 0)
        self.assertRaises(HostLookupError, result.get_host,
                          **dict(retry_count=1))
Example #2
0
    def test_get_host(self):
        ips = [
            '74.125.225.229',  # ARIN
            '2001:4860:4860::8888'
        ]

        for ip in ips:
            result = Net(ip)
            try:
                self.assertIsInstance(result.get_host(0), tuple)
            except HostLookupError:
                pass
            except AssertionError as e:
                raise e
            except Exception as e:
                self.fail('Unexpected exception raised: {0}'.format(e))

        result = Net('74.125.225.229', 0)
        self.assertRaises(HostLookupError, result.get_host, **dict(
            retry_count=1))