Example #1
0
 def test_read_compressed_files(self):
     """Theat Intel - Read compressed csv.gz files into a dictionary"""
     intelligence = StreamThreatIntel.read_compressed_files('tests/unit/fixtures')
     assert_is_instance(intelligence, dict)
     assert_list_equal(sorted(intelligence.keys()),
                       sorted(['domain', 'md5', 'ip']))
     assert_equal(len(intelligence['domain']), 10)
     assert_equal(len(intelligence['md5']), 10)
     assert_equal(len(intelligence['ip']), 10)
Example #2
0
 def test_read_compressed_files_not_exist(self):
     """Threat Intel - Location of intelligence files not exist"""
     # self.threat_intel = ti.StreamThreatIntel('not/exist/dir')
     intelligence = StreamThreatIntel.read_compressed_files('not/exist/dir')
     assert_equal(intelligence, None)