Skip to content

Commit af94fa1

Browse files
committed
Add test for creating venv with system packages
1 parent 736af25 commit af94fa1

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

test/test_deployment.py

+14
Original file line numberDiff line numberDiff line change
@@ -237,6 +237,20 @@ def test_create_venv_with_setuptools(callmock):
237237
'--log=' + os.path.abspath('foo')], d.pip_prefix)
238238

239239

240+
@patch('tempfile.NamedTemporaryFile', FakeTemporaryFile)
241+
@patch('subprocess.check_call')
242+
def test_create_venv_with_system_packages(callmock):
243+
d = Deployment('test', use_system_packages=True)
244+
d.create_virtualenv()
245+
eq_('debian/test/usr/share/python/test', d.package_dir)
246+
callmock.assert_called_with(['virtualenv', '--system-site-packages',
247+
'debian/test/usr/share/python/test'])
248+
eq_([PY_CMD,
249+
PIP_CMD,
250+
'install',
251+
'--log=' + os.path.abspath('foo')], d.pip_prefix)
252+
253+
240254
@patch('tempfile.NamedTemporaryFile', FakeTemporaryFile)
241255
@patch('subprocess.check_call')
242256
def test_venv_with_custom_python(callmock):

0 commit comments

Comments
 (0)