Example #1
0
    def test_installing_a_packaging_into_virtualenv(self, mock_local, venv,
                                                    setup, expected):
        assert not mock_local.called
        with mock.patch('ship_it.virtualenv._build_virtualenv',
                        return_value=quote(venv)):
            virtualenv.install_package_in_virtualenv(venv, setup)

        mock_local.assert_called_once_with(expected)
Example #2
0
def _package_virtualenv_with_manifest(manifest, requirements_file_path,
                                      setup_py_path):
    """
    Given a manifest, package up the virtualenv, either by copying in the
    top-level directory, or by installing it into the virtualenv with:
    ``python setup.py install``. This is determined using the manifest's
    "method" key, with the value "copy." Anything else will be considered an
    install.
    """

    venv = manifest.local_virtualenv_path
    if manifest.contents.get('method') == 'copy':
        virtualenv.copy_package_in_virtualenv(venv, requirements_file_path,
                                              manifest.local_package_path)
    else:
        virtualenv.install_package_in_virtualenv(venv, setup_py_path)
Example #3
0
def test_handle_odd_setup_paths(setup_path, valid):
    if not valid:
        with pytest.raises(AssertionError):
            virtualenv.install_package_in_virtualenv('/some/path', setup_path)
    else:
        virtualenv.install_package_in_virtualenv('/some/path', setup_path)