diff options
author | Romain Gonçalves <me@rgoncalves.se> | 2022-10-04 23:34:57 +0200 |
---|---|---|
committer | Romain Gonçalves <me@rgoncalves.se> | 2022-10-04 23:34:57 +0200 |
commit | aa1fa5271fa53971587fafe270ac225dc0e79334 (patch) | |
tree | fc220dcb22f1f98774c75ecaec8d3c4b45dbc506 /tests | |
parent | 20e6e83183bb4dd1fec54cdc50e462f15c8133cd (diff) | |
download | pydanclick-aa1fa5271fa53971587fafe270ac225dc0e79334.tar.gz |
fixup! wip: externalize generation of option arguments
Diffstat (limited to 'tests')
-rw-r--r-- | tests/conftest.py | 16 | ||||
-rw-r--r-- | tests/test_core.py | 7 |
2 files changed, 20 insertions, 3 deletions
diff --git a/tests/conftest.py b/tests/conftest.py index 5871ed8..e598a79 100644 --- a/tests/conftest.py +++ b/tests/conftest.py @@ -1 +1,17 @@ +from enum import Enum +from pydantic import BaseModel, Field + import pytest + + +class GenericArguments(BaseModel): + + class FruitEnum(str, Enum): + apple = "apple" + banana = "banana" + pineapple = "pineapple" + + name: str = Field(min_length=10) + version: int = Field(gt=0) + force: bool = Field(default=False, description="Force ABC.") + fruit: FruitEnum diff --git a/tests/test_core.py b/tests/test_core.py index 10e3b6c..5993abc 100644 --- a/tests/test_core.py +++ b/tests/test_core.py @@ -1,7 +1,8 @@ import pytest -from pydanclick import core +from pydanclick import core, schemas +from tests.conftest import GenericArguments -def test_generate_cli_option_ok(): - assert True +def test_get_option_arguments_ok(): + core.get_option_arguments() |