11# This module is part of GitPython and is released under
22# the BSD License: http://www.opensource.org/licenses/bsd-license.php
33
4+ import ast
45import os
56import subprocess
67from test .lib import TestBase
@@ -27,3 +28,8 @@ def test_installation(self, rw_dir):
2728self .assertEqual (0 ,result .returncode ,msg = result .stderr or result .stdout or "Can't build - setup.py failed" )
2829result = subprocess .run ([self .python ,'-c' ,'import git' ],stdout = subprocess .PIPE ,cwd = self .sources )
2930self .assertEqual (0 ,result .returncode ,msg = result .stderr or result .stdout or "Selftest failed" )
31+ result = subprocess .run ([self .python ,'-c' ,'import sys;import git; print(sys.path)' ],stdout = subprocess .PIPE ,cwd = self .sources )
32+ syspath = result .stdout .decode ('utf-8' ).splitlines ()[0 ]
33+ syspath = ast .literal_eval (syspath )
34+ self .assertEqual ('' ,syspath [0 ],msg = 'Failed to follow the conventions for https://docs.python.org/3/library/sys.html#sys.path' )
35+ self .assertTrue (syspath [1 ].endswith ('gitdb' ),msg = 'Failed to add gitdb to sys.path' )