async def test_zipbomb(self): async with AAPI() as api: probelist = await api.probes.list() probe = 'Unarchive' if probe not in probelist: raise asynctest.SkipTest( "Skipping {} not present".format(probe)) sample = SAMPLES_DIR / ZIP_SAMPLE scan = api.scans.scan([sample], linger=True, probes=[probe], force=True) self.assertEqual(len(scan.results), 1) self.assertEqual(scan.probes_finished, 1) result = await api.scans.result(scan.results[0]) self.assertEqual(len(result.probe_results), 1) probe_result = result.probe_results[0] self.assertEqual(probe_result.status, -1) self.assertIsNotNone(probe_result.error) self.assertNone(probe_result.results)
async def setUp(self): async with AAPI() as api: self.probes = await api.probes.list()
async def test_file_search_not_existing_tag(self): invalid_tagid = max(x.id for x in self.taglist) + 1 async with AAPI() as api: with self.assertRaises(IrmaError): await api.files.search({'tags': invalid_tagid})
async def test_tag_list(self): async with AAPI() as api: self.assertEqual(len(await api.tags.list()), len(self.taglist))