Пример #1
0
 def test_vt_hash_check(self):
     vt_api = os.environ["VT_API"]
     self.assertIsNone(ub.vt_hash_check('asdf', vt_api))
     vt_hash_data = ub.vt_hash_check("fe03b4181707f1ea1f3c69dc0a9904181c6fce91", vt_api)
     self.assertIsInstance(vt_hash_data, dict)
     self.assertIn('resource', vt_hash_data)
     self.assertIn('positives', vt_hash_data)
     self.assertGreater(vt_hash_data['positives'], 0)
     time.sleep(15)  # VT rate limiting
     vt_hash_data = ub.vt_hash_check("d41d8cd98f00b204e9800998ecf8427e", vt_api)
     self.assertIn('positives', vt_hash_data)
     self.assertEqual(vt_hash_data['positives'], 0)
     time.sleep(15)  # VT rate limiting
Пример #2
0
 def test_vt_rate_limiting(self):
     vt_api = os.environ["VT_API"]
     # Exceed 4x in 60 seconds
     data = ub.vt_hash_check("d41d8cd98f00b204e9800998ecf8427e", vt_api)
     self.assertIsInstance(data, dict)
     data = ub.vt_hash_check("d41d8cd98f00b204e9800998ecf8427e", vt_api)
     data = ub.vt_hash_check("d41d8cd98f00b204e9800998ecf8427e", vt_api)
     data = ub.vt_hash_check("d41d8cd98f00b204e9800998ecf8427e", vt_api)
     data = ub.vt_name_check("example.org", vt_api)
     self.assertIsNone(data)
     data = ub.vt_ip_check("192.30.252.130", vt_api)
     self.assertIsNone(data)
     data = ub.vt_hash_check("d41d8cd98f00b204e9800998ecf8427e", vt_api)
     self.assertIsNone(data)
     time.sleep(15)
Пример #3
0
 def test_vt_hash_check(self):
     vt_api = os.environ["VT_API"]
     self.assertIsNone(ub.vt_hash_check('asdf', vt_api))
     vt_hash_data = ub.vt_hash_check(
         "fe03b4181707f1ea1f3c69dc0a9904181c6fce91", vt_api)
     self.assertIsInstance(vt_hash_data, dict)
     self.assertIn('resource', vt_hash_data)
     self.assertIn('positives', vt_hash_data)
     self.assertGreater(vt_hash_data['positives'], 0)
     time.sleep(15)  # VT rate limiting
     vt_hash_data = ub.vt_hash_check("d41d8cd98f00b204e9800998ecf8427e",
                                     vt_api)
     self.assertIn('positives', vt_hash_data)
     self.assertEqual(vt_hash_data['positives'], 0)
     time.sleep(15)  # VT rate limiting
Пример #4
0
 def test_vt_rate_limiting(self):
     vt_api = os.environ["VT_API"]
     # Exceed 4x in 60 seconds
     data = ub.vt_hash_check("d41d8cd98f00b204e9800998ecf8427e", vt_api)
     self.assertIsInstance(data, dict)
     data = ub.vt_hash_check("d41d8cd98f00b204e9800998ecf8427e", vt_api)
     data = ub.vt_hash_check("d41d8cd98f00b204e9800998ecf8427e", vt_api)
     data = ub.vt_hash_check("d41d8cd98f00b204e9800998ecf8427e", vt_api)
     data = ub.vt_name_check("example.org", vt_api)
     self.assertIsNone(data)
     data = ub.vt_ip_check("192.30.252.130", vt_api)
     self.assertIsNone(data)
     data = ub.vt_hash_check("d41d8cd98f00b204e9800998ecf8427e", vt_api)
     self.assertIsNone(data)
     time.sleep(15)