summaryrefslogtreecommitdiffstats
path: root/tests/conftest.py
diff options
context:
space:
mode:
authorRomain Gonçalves <me@rgoncalves.se>2022-10-06 22:33:48 +0200
committerRomain Gonçalves <me@rgoncalves.se>2022-10-06 22:33:48 +0200
commit0cec8c42c0a3c994285b93db5ee2881042586672 (patch)
tree7aee09c4955506a8654286018345364a08bb48cf /tests/conftest.py
parenta66d538e8d3213b185d1dda6ebb44d22e7fdc707 (diff)
downloadpydanclick-0cec8c42c0a3c994285b93db5ee2881042586672.tar.gz
wip: decorator + arguments tests
Diffstat (limited to 'tests/conftest.py')
-rw-r--r--tests/conftest.py28
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
remember that computers suck.