tests: split out match tests and validate alternative algorithms

This commit is contained in:
William Ballenthin
2021-11-10 12:44:58 -07:00
parent 1406dc28d9
commit 845df282ef
4 changed files with 547 additions and 454 deletions

View File

@@ -3,7 +3,20 @@ import textwrap
import capa.rules
import capa.render.utils
import capa.render.result_document
import capa.features.insn
import capa.features.common
def test_render_number():
assert str(capa.features.insn.Number(1)) == "number(0x1)"
assert str(capa.features.insn.Number(1, bitness=capa.features.common.BITNESS_X32)) == "number/x32(0x1)"
assert str(capa.features.insn.Number(1, bitness=capa.features.common.BITNESS_X64)) == "number/x64(0x1)"
def test_render_offset():
assert str(capa.features.insn.Offset(1)) == "offset(0x1)"
assert str(capa.features.insn.Offset(1, bitness=capa.features.common.BITNESS_X32)) == "offset/x32(0x1)"
assert str(capa.features.insn.Offset(1, bitness=capa.features.common.BITNESS_X64)) == "offset/x64(0x1)"
def test_render_meta_attack():
# Persistence::Boot or Logon Autostart Execution::Registry Run Keys / Startup Folder [T1547.001]