Ejemplo n.º 1
0
 def test_install_python_packages_uses_pip_first(self, command_mock):
     installer.detect_pip = Mock()
     installer.detect_pip.return_value = "pip"
     command_mock.return_value = Mock()
     installer.install_python_packages(self.PYTHON_MODULES)
     command_mock.assert_called_with(
         "pip install --quiet --upgrade --force-reinstall " +
         " ".join(self.PYTHON_MODULES),
         'Installing python dependencies',
         exit_on_failure=True)
Ejemplo n.º 2
0
 def test_install_python_packages_uses_easy_install_when_pip_is_not_available(
         self, command_mock):
     installer.detect_pip = Mock()
     installer.detect_pip.side_effect = CalledProcessError(
         cmd="which python-pip", returncode=1)
     command_mock.return_value = Mock()
     installer.install_python_packages(self.PYTHON_MODULES)
     command_mock.assert_called_with("easy_install -U --quiet " +
                                     " ".join(self.PYTHON_MODULES),
                                     "Installing python dependencies",
                                     exit_on_failure=True)