def testBlobIsMarkedAsYaraSignature(self): args = api_yara.ApiUploadYaraSignatureArgs() args.signature = "rule foo { condition: false };" blob_id = self.handler.Handle(args, token=self.token).blob_id self.assertTrue(data_store.REL_DB.VerifyYaraSignatureReference(blob_id))
def testSignatureIsUploadedToBlobStore(self): signature = "rule foo { condition: true };" args = api_yara.ApiUploadYaraSignatureArgs() args.signature = signature blob_id = self.handler.Handle(args, context=self.context).blob_id blob = data_store.BLOBS.ReadBlob(blob_id) self.assertEqual(blob.decode("utf-8"), signature)