Example #1
0
    def test_uninstall_is_called(self, mock_sudo, mock_version_check):
        env.host = "any_host"
        mock_sudo.side_effect = self.mock_fail_then_succeed()

        server.uninstall()

        mock_version_check.assert_called_with()
        mock_sudo.assert_any_call('rpm -e presto')
        mock_sudo.assert_called_with('rpm -e presto-server-rpm')
Example #2
0
    def test_uninstall_is_called(self, mock_package_rpm_uninstall, mock_package_is_rpm_installed, mock_version_check):
        env.host = "any_host"
        mock_package_is_rpm_installed.side_effect = [False, True]

        server.uninstall()

        mock_version_check.assert_called_with()
        mock_package_is_rpm_installed.assert_called_with('presto-server')
        mock_package_rpm_uninstall.assert_called_with('presto-server')
        self.assertTrue(mock_package_is_rpm_installed.call_count == 2)
        self.assertTrue(mock_package_rpm_uninstall.call_count == 1)
Example #3
0
    def test_uninstall_is_called(self, mock_package_rpm_uninstall, mock_package_is_rpm_installed, mock_version_check):
        env.host = "any_host"
        mock_package_is_rpm_installed.side_effect = [False, True]

        server.uninstall()

        mock_version_check.assert_called_with()
        mock_package_is_rpm_installed.assert_called_with('presto-server')
        mock_package_rpm_uninstall.assert_called_with('presto-server')
        self.assertTrue(mock_package_is_rpm_installed.call_count == 2)
        self.assertTrue(mock_package_rpm_uninstall.call_count == 1)
Example #4
0
    def test_uninstall_is_called(self, mock_sudo, mock_version_check):
        env.host = "any_host"
        output1 = _AttributeString()
        output1.succeeded = False
        output2 = _AttributeString()
        output2.succeeded = True
        mock_sudo.side_effect = [output1, output2]

        server.uninstall()

        mock_version_check.assert_called_with()
        mock_sudo.assert_any_call('rpm -e presto')
        mock_sudo.assert_called_with('rpm -e presto-server-rpm')
Example #5
0
    def test_uninstall_is_called(self, mock_sudo, mock_version_check):
        env.host = "any_host"
        output1 = _AttributeString()
        output1.succeeded = False
        output2 = _AttributeString()
        output2.succeeded = True
        mock_sudo.side_effect = [output1, output2]

        server.uninstall()

        mock_version_check.assert_called_with()
        mock_sudo.assert_any_call('rpm -e presto')
        mock_sudo.assert_called_with('rpm -e presto-server-rpm')
Example #6
0
 def test_uninstall_is_called(self, mock_sudo, mock_version_check):
     env.host = "any_host"
     server.uninstall()
     mock_version_check.assert_called_with()
     mock_sudo.assert_called_with('rpm -e presto')