From e2e367f0918345a01fce7caedeea087d7cf4c4bc Mon Sep 17 00:00:00 2001 From: Yacine Elhamer Date: Mon, 10 Jul 2023 12:15:06 +0100 Subject: [PATCH] update tests --- tests/fixtures.py | 6 +++--- tests/test_freeze.py | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/tests/fixtures.py b/tests/fixtures.py index 6532729f..9369d5e4 100644 --- a/tests/fixtures.py +++ b/tests/fixtures.py @@ -421,14 +421,14 @@ def sample(request): def get_process(extractor, ppid: int, pid: int) -> ProcessHandle: for ph in extractor.get_processes(): - if ph.inner["ppid"] == ppid and ph.pid == pid: - return ProcessHandle(pid, {"ppid": ppid}) + if ph.address.ppid == ppid and ph.address.pid == pid: + return ph raise ValueError("process not found") def get_thread(extractor, ph: ProcessHandle, tid: int) -> ThreadHandle: for th in extractor.get_threads(ph): - if th.tid == tid: + if th.address.tid == tid: return th raise ValueError("thread not found") diff --git a/tests/test_freeze.py b/tests/test_freeze.py index 2c5f1920..b3a4536e 100644 --- a/tests/test_freeze.py +++ b/tests/test_freeze.py @@ -22,7 +22,7 @@ import capa.features.extractors.null import capa.features.extractors.base_extractor from capa.features.address import AbsoluteVirtualAddress -EXTRACTOR = capa.features.extractors.null.NullFeatureExtractor( +EXTRACTOR = capa.features.extractors.null.NullStaticFeatureExtractor( base_address=AbsoluteVirtualAddress(0x401000), global_features=[], file_features=[ @@ -117,8 +117,8 @@ def compare_extractors(a, b): def test_freeze_str_roundtrip(): - load = capa.features.freeze.loads - dump = capa.features.freeze.dumps + load = capa.features.freeze.loads_static + dump = capa.features.freeze.dumps_static reanimated = load(dump(EXTRACTOR)) compare_extractors(EXTRACTOR, reanimated)