Ejemplo n.º 1
0
    def test_virtualenv_build_with_download(self):
        config = {
            "project_name": "ubuild",
            "virtualenv_path": "/opt/venv/virtual",
            "requirements_files": ["foo.txt", "bar.txt"],
            "requirements_params": ["--allow-all-external"],
            "download_path": "/tmp/download"
        }

        virtualenv_module.build_virtualenv({}, config, self.execute)

        # make sure the last command is checkinstall...
        self.assertTrue(self.commands.pop(-1).startswith("checkinstall "))

        self.assertEqual([
            "mkdir -p /tmp/download",
            "pip install --download /tmp/download -r foo.txt -r bar.txt "
            "--allow-all-external"
        ], self.commands)

        self.commands = []
        virtualenv_module.execute_virtualenv({}, config, self.execute)

        self.assertEqual([
            "mkdir -p /opt/venv",
            "virtualenv /opt/venv/virtual --always-copy",
            "/opt/venv/virtual/bin/pip install -I --no-index "
            "--find-links file:///tmp/download -r foo.txt -r bar.txt "
            "--allow-all-external",
            "/opt/venv/virtual/bin/python setup.py install"
        ], self.commands)
Ejemplo n.º 2
0
 def test_virtualenv_build_simple_requirements(self):
     config = {
         "virtualenv_path": "/opt/venv",
         "project_name": "foobar",
         "requirements_files": [],
         "download_path": "/tmp/download"
     }
     virtualenv_module.build_virtualenv({}, config, self.execute)
     self.assertTrue(True, "Executed without issue.")