| Total Complexity | 1 |
| Total Lines | 23 |
| Duplicated Lines | 0 % |
| Changes | 0 | ||
| 1 | import os |
||
| 2 | import sys |
||
| 3 | import unittest |
||
| 4 | |||
| 5 | from distutils.sysconfig import get_config_vars |
||
| 6 | from stakkr import package_utils as pu |
||
| 7 | |||
| 8 | base_dir = os.path.abspath(os.path.dirname(__file__)) |
||
| 9 | sys.path.insert(0, base_dir + '/../') |
||
| 10 | |||
| 11 | |||
| 12 | # https://docs.python.org/3/library/unittest.html#assert-methods |
||
| 13 | class PackageUtilsTest(unittest.TestCase): |
||
| 14 | def test_venv_basedir(self): |
||
| 15 | """Make sure, even in another directory, the venv base dir is correct""" |
||
| 16 | venv_base = pu.get_venv_basedir() |
||
| 17 | |||
| 18 | self.assertEqual(os.path.abspath(get_config_vars()['exec_prefix'] + '/../'), venv_base) |
||
| 19 | |||
| 20 | |||
| 21 | if __name__ == "__main__": |
||
| 22 | unittest.main() |
||
| 23 |