test_install.py 628 B

123456789101112131415161718192021222324
  1. import unittest
  2. import os
  3. import tempfile
  4. import shutil
  5. import subprocess
  6. class TestInstall(unittest.TestCase):
  7. def setUp(self):
  8. self.tempdir = tempfile.mkdtemp()
  9. subprocess.check_call(["virtualenv", self.tempdir])
  10. def tearDown(self):
  11. shutil.rmtree(self.tempdir)
  12. def virtualenv_bin(self, cmd):
  13. return os.path.join(self.tempdir, "bin", cmd)
  14. def test_install(self):
  15. subprocess.check_call([self.virtualenv_bin("python"), "setup.py", "install"])
  16. def test_cli(self):
  17. self.test_install()
  18. subprocess.check_call([self.virtualenv_bin("acme-tiny"), "-h"])