From a154a776aa860ed146c01a80fea978ef63610748 Mon Sep 17 00:00:00 2001 From: Zion Leonahenahe Basque Date: Sat, 20 Jan 2024 14:58:35 -0700 Subject: [PATCH] Reenable pytests (#8) --- .github/workflows/python-package.yml | 6 ++---- tests/tests.py | 2 +- varbert/__init__.py | 2 +- varbert/api.py | 1 + 4 files changed, 5 insertions(+), 6 deletions(-) diff --git a/.github/workflows/python-package.yml b/.github/workflows/python-package.yml index d89779d..fd9d77e 100644 --- a/.github/workflows/python-package.yml +++ b/.github/workflows/python-package.yml @@ -31,7 +31,5 @@ jobs: pip install . - name: Test with pytest run: | - # TODO: add install of models to test when we go public - varbert --help - # TODO: uncomment when we go public - # pytest tests/tests.py + varbert --download-models + pytest tests/tests.py diff --git a/tests/tests.py b/tests/tests.py index 93ca5c5..5baf8b4 100644 --- a/tests/tests.py +++ b/tests/tests.py @@ -3,7 +3,7 @@ from typing import Dict from varbert import VariableRenamingAPI -from yodalib.data import Function, FunctionArgument, FunctionHeader, StackVariable +from libbs.artifacts import Function, FunctionArgument, FunctionHeader, StackVariable def function_with_new_names(function: Function, new_names: Dict[str, str]): diff --git a/varbert/__init__.py b/varbert/__init__.py index 4cad5e5..dade0a8 100644 --- a/varbert/__init__.py +++ b/varbert/__init__.py @@ -1,4 +1,4 @@ -__version__ = "2.0.9" +__version__ = "2.0.10" import importlib.resources import tarfile diff --git a/varbert/api.py b/varbert/api.py index f59b864..6b68222 100644 --- a/varbert/api.py +++ b/varbert/api.py @@ -116,6 +116,7 @@ def predict_for_functions(func_addrs: Optional[List[int]] = None, decompiler: Op dec_interface = DecompilerInterface.discover(force_decompiler=decompiler) varbert = VariableRenamingAPI(decompiler_interface=dec_interface) func_addrs = func_addrs if func_addrs else dec_interface.functions + func_addrs = [dec_interface.art_lifer.lift_addr(addr) for addr in func_addrs] # grab real functions, which require decompilation, and predict names for them total_suggested_funcs = 0