Esempio n. 1
0
 def test_get_asn_whois(self):
     result = Net('74.125.225.229')
     try:
         self.assertIsInstance(result.get_asn_whois(), str)
     except ASNLookupError:
         pass
     except AssertionError as e:
         raise e
     except Exception as e:
         self.fail('Unexpected exception raised: {0}'.format(e))
Esempio n. 2
0
 def test_get_asn_whois(self):
     result = Net('74.125.225.229')
     try:
         self.assertIsInstance(result.get_asn_whois(), str)
     except ASNLookupError:
         pass
     except AssertionError as e:
         raise e
     except Exception as e:
         self.fail('Unexpected exception raised: {0}'.format(e))
Esempio n. 3
0
    def test_get_asn_whois(self):
        result = Net('74.125.225.229')
        try:
            self.assertIsInstance(result.get_asn_whois(), dict)
        except (ASNLookupError, ASNRegistryError):
            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')
        self.assertRaises(ASNLookupError, result.get_asn_whois, 3, 'a')
Esempio n. 4
0
    def test_get_asn_whois(self):
        data = ('15169   | 74.125.225.229   | 74.125.225.0/24     | US | arin'
                '     | 2007-03-13')
        result = Net('74.125.225.229')
        try:
            self.assertIsInstance(result.get_asn_whois(result=data), dict)
        except AssertionError as e:
            raise e
        except Exception as e:
            self.fail('Unexpected exception raised: {0}'.format(e))

        data = ('15169   | 74.125.225.229   | 74.125.225.0/24     | US | rdm'
                '     | 2007-03-13')
        result = Net('74.125.225.229')
        self.assertRaises(ASNRegistryError, result.get_asn_whois, 3, data)
Esempio n. 5
0
    def test_get_asn_whois(self):
        data = ('15169   | 74.125.225.229   | 74.125.225.0/24     | US | arin'
                '     | 2007-03-13')
        result = Net('74.125.225.229')
        try:
            self.assertIsInstance(result.get_asn_whois(result=data), dict)
        except AssertionError as e:
            raise e
        except Exception as e:
            self.fail('Unexpected exception raised: {0}'.format(e))

        data = ('15169   | 74.125.225.229   | 74.125.225.0/24     | US | rdm'
                '     | 2007-03-13')
        result = Net('74.125.225.229')
        self.assertRaises(ASNRegistryError, result.get_asn_whois, 3, data)