Debian Codegraph @

tests/test_install.py

raw
1 import unittest
2 import os
3 import sys
4 import tempfile
5 import shutil
6 import subprocess
7
8
9 class TestInstall(unittest.TestCase):
10 def setUp(self):
11 self.tempdir = tempfile.mkdtemp()
12 venv_cmd = ["virtualenv"] if sys.version_info[0] == 2 else ["python", "-m", "venv"]
13 subprocess.check_call(venv_cmd + [self.tempdir])
14
15 def tearDown(self):
16 shutil.rmtree(self.tempdir)
17
18 def virtualenv_bin(self, cmd):
19 return os.path.join(self.tempdir, "bin", cmd)
20
21 def test_install(self):
22 subprocess.check_call([self.virtualenv_bin("pip"), "install", "."])
23
24 def test_cli(self):
25 self.test_install()
26 subprocess.check_call([self.virtualenv_bin("acme-tiny"), "-h"])