Skip to content

Commit

Permalink
Add tests
Browse files Browse the repository at this point in the history
  • Loading branch information
ValekoZ committed Jun 9, 2024
1 parent 7c32602 commit 7e97732
Showing 1 changed file with 27 additions and 0 deletions.
27 changes: 27 additions & 0 deletions tests/config/virtualenv.py
Original file line number Diff line number Diff line change
@@ -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

0 comments on commit 7e97732

Please sign in to comment.