Passed
Push — master ( e8584f...303446 )
by Emmanuel
04:55
created

PackageUtilsTest.test_venv_basedir()   A

Complexity

Conditions 1

Size

Total Lines 5
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
eloc 3
nop 1
dl 0
loc 5
rs 10
c 0
b 0
f 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