add ip rep
This commit is contained in:
@@ -33,6 +33,22 @@ class RecommendationTests(unittest.TestCase):
|
||||
|
||||
self.assertEqual(result["status"], "disabled")
|
||||
|
||||
def test_abuseipdb_is_preferred_when_key_exists(self):
|
||||
with patch.dict(os.environ, {"FGAI_THREAT_INTEL": "1", "ABUSEIPDB_API_KEY": "test"}, clear=True):
|
||||
client = ThreatIntelClient(cache_file="/tmp/fgai-test-threat-cache.json")
|
||||
|
||||
self.assertEqual(client._select_provider(), "abuseipdb")
|
||||
|
||||
def test_virustotal_can_be_forced(self):
|
||||
with patch.dict(
|
||||
os.environ,
|
||||
{"FGAI_THREAT_INTEL": "1", "ABUSEIPDB_API_KEY": "test", "VIRUSTOTAL_API_KEY": "test", "FGAI_THREAT_INTEL_PROVIDER": "virustotal"},
|
||||
clear=True,
|
||||
):
|
||||
client = ThreatIntelClient(cache_file="/tmp/fgai-test-threat-cache.json")
|
||||
|
||||
self.assertEqual(client._select_provider(), "virustotal")
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
unittest.main()
|
||||
|
||||
Reference in New Issue
Block a user