Esempio n. 1
0
class PythonInstallerTest(mox.MoxTestBase):

    def setUp(self):
        super(PythonInstallerTest, self).setUp()
        self.mock_pythonbrew = self.mox.CreateMock(PythonBrew)

        self.python_installer = PythonInstaller(self.mock_pythonbrew)

    def test_can_create_pythoninstaller_instance(self):
        """fab.tests.environment.python.python_installer_test  Can create PythonInstaller instance"""

        mock_host_controller = self.mox.CreateMock(RemoteHostController)
        mock_host_controller.feedback = self.mox.CreateMock(ExecutionFeedback)

        self.mox.ReplayAll()

        self.assertIsInstance(PythonInstaller.create_with(mock_host_controller), PythonInstaller)

    def test_can_ensure_specified_python_version_is_installed(self):
        """fab.tests.environment.python.python_installer_test  Can ensure specified Python version is installed"""

        self.mock_pythonbrew.ensure_pythonbrew_is_installed()
        self.mock_pythonbrew.install_python("2.7.2")
        self.mock_pythonbrew.enable_python_version_for_all_users("2.7.2")
        self.mox.ReplayAll()

        self.python_installer.ensure_python_is_installed_with_version("2.7.2")
class PythonInstallerTest(mox.MoxTestBase):
    def setUp(self):
        super(PythonInstallerTest, self).setUp()
        self.mock_pythonbrew = self.mox.CreateMock(PythonBrew)

        self.python_installer = PythonInstaller(self.mock_pythonbrew)

    def test_can_create_pythoninstaller_instance(self):
        """fab.tests.environment.python.python_installer_test  Can create PythonInstaller instance"""

        mock_host_controller = self.mox.CreateMock(RemoteHostController)
        mock_host_controller.feedback = self.mox.CreateMock(ExecutionFeedback)

        self.mox.ReplayAll()

        self.assertIsInstance(
            PythonInstaller.create_with(mock_host_controller), PythonInstaller)

    def test_can_ensure_specified_python_version_is_installed(self):
        """fab.tests.environment.python.python_installer_test  Can ensure specified Python version is installed"""

        self.mock_pythonbrew.ensure_pythonbrew_is_installed()
        self.mock_pythonbrew.install_python("2.7.2")
        self.mock_pythonbrew.enable_python_version_for_all_users("2.7.2")
        self.mox.ReplayAll()

        self.python_installer.ensure_python_is_installed_with_version("2.7.2")
Esempio n. 3
0
    def create_with(deployment_host_config):
        host_controller = RemoteHostController()

        return LinuxHost(DeploymentUserVerifier(AkvoPermissions(host_controller)),
                         PythonInstaller.create_with(host_controller),
                         UbuntuPackageInspector(host_controller),
                         LinuxPackageVerifier.create_with(host_controller),
                         SystemPythonPackageInstaller.create_with(deployment_host_config, host_controller),
                         host_controller.feedback)
Esempio n. 4
0
    def test_can_create_pythoninstaller_instance(self):
        """fab.tests.environment.python.python_installer_test  Can create PythonInstaller instance"""

        mock_host_controller = self.mox.CreateMock(RemoteHostController)
        mock_host_controller.feedback = self.mox.CreateMock(ExecutionFeedback)

        self.mox.ReplayAll()

        self.assertIsInstance(PythonInstaller.create_with(mock_host_controller), PythonInstaller)
    def test_can_create_pythoninstaller_instance(self):
        """fab.tests.environment.python.python_installer_test  Can create PythonInstaller instance"""

        mock_host_controller = self.mox.CreateMock(RemoteHostController)
        mock_host_controller.feedback = self.mox.CreateMock(ExecutionFeedback)

        self.mox.ReplayAll()

        self.assertIsInstance(
            PythonInstaller.create_with(mock_host_controller), PythonInstaller)
Esempio n. 6
0
    def create_with(deployment_host_config):
        host_controller = RemoteHostController()

        return LinuxHost(
            DeploymentUserVerifier(AkvoPermissions(host_controller)),
            PythonInstaller.create_with(host_controller),
            UbuntuPackageInspector(host_controller),
            LinuxPackageVerifier.create_with(host_controller),
            SystemPythonPackageInstaller.create_with(deployment_host_config,
                                                     host_controller),
            host_controller.feedback)
Esempio n. 7
0
    def setUp(self):
        super(PythonInstallerTest, self).setUp()
        self.mock_pythonbrew = self.mox.CreateMock(PythonBrew)

        self.python_installer = PythonInstaller(self.mock_pythonbrew)
    def setUp(self):
        super(PythonInstallerTest, self).setUp()
        self.mock_pythonbrew = self.mox.CreateMock(PythonBrew)

        self.python_installer = PythonInstaller(self.mock_pythonbrew)