mirror of
https://github.com/mandiant/capa.git
synced 2025-12-12 15:49:46 -08:00
Fixed Path issue in cache-ruleset.py
This commit is contained in:
@@ -59,7 +59,7 @@ def main(argv=None):
|
||||
|
||||
content = capa.rules.cache.get_ruleset_content(rules)
|
||||
id = capa.rules.cache.compute_cache_identifier(content)
|
||||
path = capa.rules.cache.get_cache_path(args.cache, id)
|
||||
path = capa.rules.cache.get_cache_path(cache_dir, id)
|
||||
|
||||
assert path.exists()
|
||||
logger.info("cached to: %s", path)
|
||||
|
||||
@@ -18,20 +18,20 @@ from fixtures import *
|
||||
CD = Path(__file__).resolve().parent
|
||||
|
||||
|
||||
def get_script_path(s):
|
||||
return CD / ".." / "scripts" / s
|
||||
def get_script_path(s: str):
|
||||
return (CD / ".." / "scripts" / s).as_posix()
|
||||
|
||||
|
||||
def get_file_path():
|
||||
return CD / "data" / "9324d1a8ae37a36ae560c37448c9705a.exe_"
|
||||
return (CD / "data" / "9324d1a8ae37a36ae560c37448c9705a.exe_").as_posix()
|
||||
|
||||
|
||||
def get_rules_path():
|
||||
return CD / ".." / "rules"
|
||||
return (CD / ".." / "rules").as_posix()
|
||||
|
||||
|
||||
def get_rule_path():
|
||||
return get_rules_path() / "lib" / "allocate-memory.yml"
|
||||
return (Path(get_rules_path()) / "lib" / "allocate-memory.yml").as_posix()
|
||||
|
||||
|
||||
@pytest.mark.parametrize(
|
||||
@@ -63,7 +63,7 @@ def test_bulk_process(tmp_path):
|
||||
|
||||
dest_file.write_bytes(source_file.read_bytes())
|
||||
|
||||
p = run_program(get_script_path("bulk-process.py"), [t.parent])
|
||||
p = run_program(get_script_path("bulk-process.py"), [t.parent.as_posix()])
|
||||
assert p.returncode == 0
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user