From e667cd7e2dd0a7ac14ac30db38ca630ec0c5409b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Romain=20Gon=C3=A7alves?= Date: Thu, 6 Oct 2022 22:55:40 +0200 Subject: fixup! wip: decorator + arguments tests --- tests/conftest.py | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) (limited to 'tests/conftest.py') diff --git a/tests/conftest.py b/tests/conftest.py index 7d5e2c7..18f540a 100644 --- a/tests/conftest.py +++ b/tests/conftest.py @@ -3,7 +3,7 @@ import pytest from enum import Enum from pydantic import BaseModel, Field -from pydanclick import core +from pydanclick import core, decorators from typing import Generator @@ -19,6 +19,11 @@ class GenericArguments(BaseModel): force: bool = Field(default=False, description="Force ABC.") fruit: FruitEnum + integer_gt_lt: int = Field(gt=16, lt=64) + integer_ge_le: int = Field(ge=16, le=64) + integer_gt_le: int = Field(gt=16, le=64) + integer_ge_lt: int = Field(ge=16, lt=64) + @pytest.fixture def valid_arguments() -> Generator[GenericArguments, None, None]: @@ -27,14 +32,17 @@ def valid_arguments() -> Generator[GenericArguments, None, None]: version=12, force=True, fruit="pineapple", + integer_gt_lt=20, + integer_ge_le=21, + integer_gt_le=22, + integer_ge_lt=23, ) @pytest.fixture def valid_command_entrypoint() -> Generator[click.Command, None, None]: - @click.command() - @core.generate_cli_options() + @decorators.command() def entrypoint(parameters: GenericArguments): pass -- cgit v1.2.3