"""Step definitions for validation pipeline edge-case executor scenarios.

Covers non-standard executor return values (non-bool passed, non-string
message, non-dict data) and stdout/stderr printing executors.

These steps rely on ``context.vp_executor`` being a ``MockValidationExecutor``
instance, which is set up by the ``a validation pipeline test environment``
Given step in ``validation_pipeline_steps.py``.
"""

from __future__ import annotations

from typing import Any

from behave import given, use_step_matcher

use_step_matcher("re")


@given(r'the vp executor returns non-bool passed for "(?P<name>[^"]+)"')
def step_given_executor_non_bool_passed(context: Any, name: str) -> None:
    context.vp_executor.set_non_bool_passed(name)


@given(r'the vp executor returns non-string message for "(?P<name>[^"]+)"')
def step_given_executor_non_string_message(context: Any, name: str) -> None:
    context.vp_executor.set_non_string_message(name)


@given(r'the vp executor returns non-dict data for "(?P<name>[^"]+)"')
def step_given_executor_non_dict_data(context: Any, name: str) -> None:
    context.vp_executor.set_non_dict_data(name)


@given(r'the vp executor prints to stdout for "(?P<name>[^"]+)"')
def step_given_executor_prints_stdout(context: Any, name: str) -> None:
    context.vp_executor.set_prints_stdout(name)


@given(r'the vp executor prints to stderr for "(?P<name>[^"]+)"')
def step_given_executor_prints_stderr(context: Any, name: str) -> None:
    context.vp_executor.set_prints_stderr(name)
