def test_install_start_configure_presto(
            self, unused_execute_mock, configure_mock):
        presto_worker = Worker()

        presto_worker.install(self.mock_env)
        assert configure_mock.called
        configure_mock.reset_mock()

        presto_worker.start(self.mock_env)
        assert configure_mock.called
    def test_install_start_configure_presto(self, unused_execute_mock,
                                            configure_mock):
        presto_worker = Worker()

        presto_worker.install(self.mock_env)
        assert configure_mock.called
        configure_mock.reset_mock()

        presto_worker.start(self.mock_env)
        assert configure_mock.called
    def test_lifecycle_methods_shell_out_to_execute(
            self, execute_mock, unused_configure_mock):
        presto_worker = Worker()

        presto_worker.install(self.mock_env)
        assert execute_mock.call_count is 2
        assert 'wget' in execute_mock.call_args_list[0][0][0]
        assert 'rpm -i' in execute_mock.call_args_list[1][0][0]
        execute_mock.reset_mock()

        presto_worker.stop(self.mock_env)
        assert execute_mock.call_count is 1
        assert 'stop' in execute_mock.call_args_list[0][0][0]
        execute_mock.reset_mock()

        presto_worker.start(self.mock_env)
        assert execute_mock.call_count is 1
        assert 'start' in execute_mock.call_args_list[0][0][0]
        execute_mock.reset_mock()

        presto_worker.status(self.mock_env)
        assert execute_mock.call_count is 1
        assert 'status' in execute_mock.call_args_list[0][0][0]
Example #4
0
    def test_lifecycle_methods_shell_out_to_execute(self, execute_mock,
                                                    unused_configure_mock):
        presto_worker = Worker()

        presto_worker.install(self.mock_env)
        assert execute_mock.call_count is 2
        assert 'wget' in execute_mock.call_args_list[0][0][0]
        assert 'rpm -i' in execute_mock.call_args_list[1][0][0]
        execute_mock.reset_mock()

        presto_worker.stop(self.mock_env)
        assert execute_mock.call_count is 1
        assert 'stop' in execute_mock.call_args_list[0][0][0]
        execute_mock.reset_mock()

        presto_worker.start(self.mock_env)
        assert execute_mock.call_count is 1
        assert 'start' in execute_mock.call_args_list[0][0][0]
        execute_mock.reset_mock()

        presto_worker.status(self.mock_env)
        assert execute_mock.call_count is 1
        assert 'status' in execute_mock.call_args_list[0][0][0]