diff options
| author | Sebastian Thiel <sebastian.thiel@icloud.com> | 2022-05-18 07:43:53 +0800 |
|---|---|---|
| committer | Sebastian Thiel <sebastian.thiel@icloud.com> | 2022-05-18 07:43:53 +0800 |
| commit | 21ec529987d10e0010badd37f8da3274167d436f (patch) | |
| tree | a3394cfe902ce7edd07c89420c21c13274a2d295 /test/test_installation.py | |
| parent | b30720ee4d9762a03eae4fa7cfa4b0190d81784d (diff) | |
| download | gitpython-21ec529987d10e0010badd37f8da3274167d436f.tar.gz | |
Run everything through 'black'
That way people who use it won't be deterred, while it unifies style
everywhere.
Diffstat (limited to 'test/test_installation.py')
| -rw-r--r-- | test/test_installation.py | 61 |
1 files changed, 45 insertions, 16 deletions
diff --git a/test/test_installation.py b/test/test_installation.py index 6117be98..2607ff4e 100644 --- a/test/test_installation.py +++ b/test/test_installation.py @@ -11,9 +11,9 @@ from test.lib.helper import with_rw_directory class TestInstallation(TestBase): def setUp_venv(self, rw_dir): self.venv = rw_dir - subprocess.run(['virtualenv', self.venv], stdout=subprocess.PIPE) - self.python = os.path.join(self.venv, 'bin/python3') - self.pip = os.path.join(self.venv, 'bin/pip3') + subprocess.run(["virtualenv", self.venv], stdout=subprocess.PIPE) + self.python = os.path.join(self.venv, "bin/python3") + self.pip = os.path.join(self.venv, "bin/pip3") self.sources = os.path.join(self.venv, "src") self.cwd = os.path.dirname(os.path.dirname(__file__)) os.symlink(self.cwd, self.sources, target_is_directory=True) @@ -21,17 +21,46 @@ class TestInstallation(TestBase): @with_rw_directory def test_installation(self, rw_dir): self.setUp_venv(rw_dir) - result = subprocess.run([self.pip, 'install', '-r', 'requirements.txt'], - stdout=subprocess.PIPE, cwd=self.sources) - self.assertEqual(0, result.returncode, msg=result.stderr or result.stdout or "Can't install requirements") - result = subprocess.run([self.python, 'setup.py', 'install'], stdout=subprocess.PIPE, cwd=self.sources) - self.assertEqual(0, result.returncode, msg=result.stderr or result.stdout or "Can't build - setup.py failed") - result = subprocess.run([self.python, '-c', 'import git'], stdout=subprocess.PIPE, cwd=self.sources) - self.assertEqual(0, result.returncode, msg=result.stderr or result.stdout or "Selftest failed") - result = subprocess.run([self.python, '-c', 'import sys;import git; print(sys.path)'], - stdout=subprocess.PIPE, cwd=self.sources) - syspath = result.stdout.decode('utf-8').splitlines()[0] + result = subprocess.run( + [self.pip, "install", "-r", "requirements.txt"], + stdout=subprocess.PIPE, + cwd=self.sources, + ) + self.assertEqual( + 0, + result.returncode, + msg=result.stderr or result.stdout or "Can't install requirements", + ) + result = subprocess.run( + [self.python, "setup.py", "install"], + stdout=subprocess.PIPE, + cwd=self.sources, + ) + self.assertEqual( + 0, + result.returncode, + msg=result.stderr or result.stdout or "Can't build - setup.py failed", + ) + result = subprocess.run( + [self.python, "-c", "import git"], stdout=subprocess.PIPE, cwd=self.sources + ) + self.assertEqual( + 0, + result.returncode, + msg=result.stderr or result.stdout or "Selftest failed", + ) + result = subprocess.run( + [self.python, "-c", "import sys;import git; print(sys.path)"], + stdout=subprocess.PIPE, + cwd=self.sources, + ) + syspath = result.stdout.decode("utf-8").splitlines()[0] syspath = ast.literal_eval(syspath) - self.assertEqual('', syspath[0], - msg='Failed to follow the conventions for https://docs.python.org/3/library/sys.html#sys.path') - self.assertTrue(syspath[1].endswith('gitdb'), msg='Failed to add gitdb to sys.path') + self.assertEqual( + "", + syspath[0], + msg="Failed to follow the conventions for https://docs.python.org/3/library/sys.html#sys.path", + ) + self.assertTrue( + syspath[1].endswith("gitdb"), msg="Failed to add gitdb to sys.path" + ) |
