diff options
Diffstat (limited to 'tests/conftest.py')
-rw-r--r-- | tests/conftest.py | 28 |
1 files changed, 26 insertions, 2 deletions
diff --git a/tests/conftest.py b/tests/conftest.py index e598a79..7d5e2c7 100644 --- a/tests/conftest.py +++ b/tests/conftest.py @@ -1,7 +1,10 @@ +import click +import pytest + from enum import Enum from pydantic import BaseModel, Field - -import pytest +from pydanclick import core +from typing import Generator class GenericArguments(BaseModel): @@ -15,3 +18,24 @@ class GenericArguments(BaseModel): version: int = Field(gt=0) force: bool = Field(default=False, description="Force ABC.") fruit: FruitEnum + + +@pytest.fixture +def valid_arguments() -> Generator[GenericArguments, None, None]: + yield GenericArguments( + name="fruit_manager", + version=12, + force=True, + fruit="pineapple", + ) + + +@pytest.fixture +def valid_command_entrypoint() -> Generator[click.Command, None, None]: + + @click.command() + @core.generate_cli_options() + def entrypoint(parameters: GenericArguments): + pass + + yield entrypoint |