def test_handle_odd_reqfile_paths(req_file_path, valid): args = '/some/path', req_file_path, '/other/path' if not valid: with pytest.raises(AssertionError): virtualenv.copy_package_in_virtualenv(*args) else: virtualenv.copy_package_in_virtualenv(*args)
def test_copying_a_packaging_into_virtualenv(self, mock_local, venv, pkg_dir, req, expected): assert not mock_local.called with mock.patch('ship_it.virtualenv._build_virtualenv', return_value=quote(venv)): virtualenv.copy_package_in_virtualenv(venv, req, pkg_dir) assert mock_local.mock_calls == [mock.call(exp) for exp in expected]
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)