Пример #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)
Пример #2
0
    def test_virtualenv_build(self):
        config = {
            "virtualenv_path": "/opt/venv/virtual",
            "requirements_files": ["requirements.txt", "extra-reqs.txt"],
            "requirements_params": ["--allow-all-external"]
        }

        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 "
            "-r requirements.txt -r extra-reqs.txt --allow-all-external",
            "/opt/venv/virtual/bin/python setup.py install"
        ], self.commands)