def test_custom_src_dir(callmock): d = Deployment("test") d.pip_prefix = ["pip", "install"] d.sourcedirectory = "root/srv/application" d.create_virtualenv() d.install_dependencies() callmock.assert_called_with( [ "debian/test/usr/share/python/test/bin/python", "debian/test/usr/share/python/test/bin/pip", "install", "--log=foo", "-r", "root/srv/application/requirements.txt", ] ) d.install_package() callmock.assert_called_with( [ "debian/test/usr/share/python/test/bin/python", "debian/test/usr/share/python/test/bin/pip", "install", "--log=foo", "root/srv/application", ] )
def test_install_package(callmock): d = Deployment('test') d.bin_dir = 'derp' d.pip_prefix = ['derp/python', 'derp/pip'] d.install_package() callmock.assert_called_with([ 'derp/python', 'derp/pip', '.', ], cwd=os.getcwd())
def test_install_package(callmock): d = Deployment('test') d.bin_dir = 'derp' d.install_package() callmock.assert_called_with([ 'derp/python', 'setup.py', 'install', '--record', 'foo', '--install-headers', 'debian/test/usr/share/python/test/include/site/python2.6' ])
def test_install_package(callmock): d = Deployment('test') d.bin_dir = 'derp' d.install_package() callmock.assert_called_with([ 'derp/python', 'setup.py', 'install', '--record', 'foo', '--install-headers', 'debian/test/usr/share/python/test/include/site/python2.6' ])
def test_custom_pip_tool_used_for_installation(callmock, _): d = Deployment( 'test', preinstall=['pip-custom-platform'], pip_tool='pip-custom-platform', ) d.install_dependencies() d.install_package() callmock.assert_has_calls([ call([PY_CMD, PIP_CMD, 'install', LOG_ARG, 'pip-custom-platform']), call([PY_CMD, CUSTOM_PIP_CMD, 'install', LOG_ARG, '-r', './requirements.txt']), call([PY_CMD, CUSTOM_PIP_CMD, 'install', LOG_ARG, '.'], cwd=os.path.abspath('.')), ])
def test_custom_pip_tool_used_for_installation(callmock, _): d = Deployment( 'test', preinstall=['pip-custom-platform'], pip_tool='pip-custom-platform', ) d.install_dependencies() d.install_package() callmock.assert_has_calls([ call([PY_CMD, PIP_CMD, 'install', LOG_ARG, 'pip-custom-platform']), call([PY_CMD, CUSTOM_PIP_CMD, 'install', LOG_ARG, '-r', './requirements.txt']), call([PY_CMD, CUSTOM_PIP_CMD, 'install', LOG_ARG, '.'], cwd=os.path.abspath('.')), ])
def test_custom_src_dir(callmock): d = Deployment('test') d.sourcedirectory = 'root/srv/application' d.create_virtualenv() d.install_dependencies() callmock.assert_called_with([ PY_CMD, PIP_CMD, 'install', LOG_ARG, '-r', 'root/srv/application/requirements.txt' ], ) d.install_package() callmock.assert_called_with([ PY_CMD, PIP_CMD, 'install', LOG_ARG, '.', ], cwd=os.path.abspath('root/srv/application'))
def test_custom_src_dir(callmock): d = Deployment('test') d.pip_prefix = ['pip', 'install'] d.sourcedirectory = 'root/srv/application' d.create_virtualenv() d.install_dependencies() callmock.assert_called_with([ 'debian/test/usr/share/python/test/bin/python', 'debian/test/usr/share/python/test/bin/pip', 'install', '--log=foo', '-r', 'root/srv/application/requirements.txt' ], ) d.install_package() callmock.assert_called_with([ 'debian/test/usr/share/python/test/bin/python', 'debian/test/usr/share/python/test/bin/pip', 'install', '--log=foo', 'root/srv/application', ])
def test_custom_src_dir(callmock): d = Deployment('test') d.sourcedirectory = 'root/srv/application' d.create_virtualenv() d.install_dependencies() callmock.assert_called_with([ PY_CMD, PIP_CMD, 'install', LOG_ARG, '-r', 'root/srv/application/requirements.txt'], ) d.install_package() callmock.assert_called_with([ PY_CMD, PIP_CMD, 'install', LOG_ARG, '.', ], cwd=os.path.abspath('root/srv/application'))
def test_custom_src_dir(callmock): d = Deployment('test') d.pip_prefix = ['pip', 'install'] d.sourcedirectory = 'root/srv/application' d.create_virtualenv() d.install_dependencies() callmock.assert_called_with([ 'debian/test/usr/share/python/test/bin/python', 'debian/test/usr/share/python/test/bin/pip', 'install', '--log=foo', '-r', 'root/srv/application/requirements.txt'], ) d.install_package() callmock.assert_called_with([ 'debian/test/usr/share/python/test/bin/python', 'debian/test/usr/share/python/test/bin/pip', 'install', '--log=foo', 'root/srv/application', ])
def test_install_package(callmock): d = Deployment("test") d.bin_dir = "derp" d.pip_prefix = ["derp/python", "derp/pip"] d.install_package() callmock.assert_called_with(["derp/python", "derp/pip", "."])