def test_setupVenv_installsVenv(self): print("ARRANGE - SETUPVENV") print("-" * 20) venv_path = str(PACKAGE_PATH) + "/env/bin/python3" print("Path to venv python:", venv_path) print("ACT - SETUPVENV") print("-" * 20) setup.setupVenv() print("ASSERT - SETUPVENV") print("-" * 20) self.assertTrue(setup.os.path.exists(venv_path))
def test_addActivator_copiesFile(self): print("ARRANGE - ADDACTIVATOR") print("-" * 20) setup.setupVenv() print("ACT - ADDACTIVATOR") print("-" * 20) setup.addActivator() print("ASSERT - ADDACTIVATOR") print("-" * 20) self.assertTrue( setup.os.path.exists( str(PACKAGE_PATH) + "/env/bin/activate_this.py"))
def test_activate_activatesVenv(self): print("ARRANGE - ACTIVATE") print("-" * 20) setup.setupVenv() setup.addActivator() process = Popen(["pip", "list"], stdout=PIPE) pip_old = process.communicate()[0].decode("utf-8") print("ACT - ACTIVATE") print("-" * 20) setup.activate() print("ASSERT - ACTIVATE") print("-" * 20) process = Popen(["pip", "list"], stdout=PIPE) pip_new = process.communicate()[0].decode("utf-8") print(pip_old) print(pip_new) self.assertNotEqual(pip_old, pip_new)
def test_install_installsDependencies(self): print("ARRANGE - INSTALL") print("-" * 20) setup.setupVenv() setup.addActivator() setup.activate() print("ACT - INSTALL") print("-" * 20) setup.install() print("ASSERT - INSTALL") print("-" * 20) pip_expected = "" with open(str(PACKAGE_PATH) + "/requirements.txt") as f: pip_expected = f.read() pip_expected = pip_expected.replace("\nsetuptools==46.4.0", "") process = Popen(["pip", "freeze"], stdout=PIPE) pip_output = process.communicate()[0].decode("utf-8") print(pip_expected) print(pip_output) self.assertEqual(pip_expected, pip_output)