| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
1 parent 961539c commit e0b10d9
2 files changed
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -2,3 +2,4 @@ ddt>=1.1.1 | |||
| 2 | 2 | coverage | |
| 3 | 3 | flake8 | |
| 4 | 4 | tox | |
| 5 | + virtualenv | ||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -0,0 +1,29 @@ | |||
| 1 | + # This module is part of GitPython and is released under | ||
| 2 | + # the BSD License: http://www.opensource.org/licenses/bsd-license.php | ||
| 3 | + | ||
| 4 | + import os | ||
| 5 | + import subprocess | ||
| 6 | + from test.lib import TestBase | ||
| 7 | + from test.lib.helper import with_rw_directory | ||
| 8 | + | ||
| 9 | + | ||
| 10 | + class TestInstallation(TestBase): | ||
| 11 | + def setUp_venv(self, rw_dir): | ||
| 12 | + self.venv = rw_dir | ||
| 13 | + subprocess.run(['virtualenv', self.venv], stdout=subprocess.PIPE) | ||
| 14 | + self.python = os.path.join(self.venv, 'bin/python3') | ||
| 15 | + self.pip = os.path.join(self.venv, 'bin/pip3') | ||
| 16 | + self.sources = os.path.join(self.venv, "src") | ||
| 17 | + self.cwd = os.path.dirname(os.path.dirname(__file__)) | ||
| 18 | + os.symlink(self.cwd, self.sources, target_is_directory=True) | ||
| 19 | + | ||
| 20 | + @with_rw_directory | ||
| 21 | + def test_installation(self, rw_dir): | ||
| 22 | + self.setUp_venv(rw_dir) | ||
| 23 | + result = subprocess.run([self.pip, 'install', '-r', 'requirements.txt'], | ||
| 24 | + stdout=subprocess.PIPE, cwd=self.sources) | ||
| 25 | + self.assertEqual(0, result.returncode, msg=result.stderr or result.stdout or "Can't install requirements") | ||
| 26 | + result = subprocess.run([self.python, 'setup.py', 'install'], stdout=subprocess.PIPE, cwd=self.sources) | ||
| 27 | + self.assertEqual(0, result.returncode, msg=result.stderr or result.stdout or "Can't build - setup.py failed") | ||
| 28 | + result = subprocess.run([self.python, '-c', 'import git'], stdout=subprocess.PIPE, cwd=self.sources) | ||
| 29 | + self.assertEqual(0, result.returncode, msg=result.stderr or result.stdout or "Selftest failed") | ||
| Back | FazBrowse Home | New Git URL |
0 commit comments