From 7e97732149e9488d9020f3af99d260dd60af21f8 Mon Sep 17 00:00:00 2001 From: ValekoZ Date: Sun, 9 Jun 2024 18:38:51 +0200 Subject: [PATCH] Add tests --- tests/config/virtualenv.py | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) create mode 100644 tests/config/virtualenv.py diff --git a/tests/config/virtualenv.py b/tests/config/virtualenv.py new file mode 100644 index 000000000..7ddbf43b7 --- /dev/null +++ b/tests/config/virtualenv.py @@ -0,0 +1,27 @@ +""" +virtualenv config test module +""" + +from tests.base import RemoteGefUnitTestGeneric +from os import system +from tempfile import mktemp + + +class VirtualenvConfig(RemoteGefUnitTestGeneric): + """virtualenv config test module""" + + def setUp(self) -> None: + venv_path = mktemp() + system(f"virtualenv {venv_path}") + system(f"{venv_path}/bin/pip install numpy") + + self.venv_path = venv_path + + return super().setUp() + + def test_conf_venv(self): + gdb = self._gdb + gdb.execute(f"gef config gef.virtualenv_path {self.venv_path}") + + res = gdb.execute("pi __import__('numpy').test()", to_string=True) + assert 'NumPy version' in res