def test__WhoisLookup(self): data_dir = path.abspath(path.join(path.dirname(__file__), '..')) with io.open(str(data_dir) + '/whois.json', 'r') as data_file: data = json.load(data_file) for key, val in data.items(): log.debug('Testing: {0}'.format(key)) net = Net(key) obj = Whois(net) try: self.assertIsInstance( obj.lookup(asn_data=val['asn_data'], get_referral=True, ignore_referral_errors=True), dict) except WhoisLookupError: pass except AssertionError as e: raise e except Exception as e: self.fail('Unexpected exception raised: {0}'.format(e))
def test__WhoisLookup(self): data_dir = path.dirname(__file__) with io.open(str(data_dir) + '/whois.json', 'r') as data_file: data = json.load(data_file) for key, val in data.items(): log.debug('Testing: {0}'.format(key)) net = Net(key) obj = Whois(net) try: self.assertIsInstance( obj.lookup(response=val['response'], asn_data=val['asn_data'], is_offline=True, inc_raw=True), dict) except AssertionError as e: raise e except Exception as e: self.fail('Unexpected exception raised: {0}'.format(e)) self.assertRaises(NetError, Whois, 'a')
def test__WhoisLookup(self): data_dir = path.abspath(path.join(path.dirname(__file__), '..')) with io.open(str(data_dir) + '/whois.json', 'r') as data_file: data = json.load(data_file) for key, val in data.items(): log.debug('Testing: {0}'.format(key)) net = Net(key) obj = Whois(net) try: self.assertIsInstance(obj.lookup(asn_data=val['asn_data']), dict) except WhoisLookupError: pass except AssertionError as e: raise e except Exception as e: self.fail('Unexpected exception raised: %r' % e)
def test__WhoisLookup(self): data_dir = path.dirname(__file__) with io.open(str(data_dir) + '/whois.json', 'r') as data_file: data = json.load(data_file) for key, val in data.items(): log.debug('Testing: {0}'.format(key)) net = Net(key) obj = Whois(net) try: self.assertIsInstance(obj.lookup(response=val['response'], asn_data=val['asn_data'], is_offline=True, inc_raw=True), dict) except AssertionError as e: raise e except Exception as e: self.fail('Unexpected exception raised: {0}'.format(e)) self.assertRaises(NetError, Whois, 'a')