forked from software-mansion/protostar
-
Notifications
You must be signed in to change notification settings - Fork 0
/
conftest.py
81 lines (58 loc) · 1.49 KB
/
conftest.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
from typing import List, Optional
import pytest
from protostar.cli.command import Command
class BaseTestCommand(Command):
@property
def name(self) -> str:
return "FOO"
@property
def description(self) -> str:
return "FOO_DESC"
@property
def example(self) -> Optional[str]:
return "$ foo"
async def run(self, args):
pass
class FooCommand(Command):
@property
def name(self) -> str:
return "FOO"
@property
def description(self) -> str:
return "FOO_DESC"
@property
def example(self) -> Optional[str]:
return "$ foo"
@property
def arguments(self) -> List[Command.Argument]:
return [
Command.Argument(
name="foo",
description="foo_desc",
example="FOO --foo",
type="bool",
)
]
async def run(self, args):
pass
class BarCommand(Command):
@property
def name(self) -> str:
return "BAR"
@property
def description(self) -> str:
return "BAR_DESC"
@property
def example(self) -> Optional[str]:
return None
@property
def arguments(self) -> List[Command.Argument]:
return []
async def run(self, args):
pass
@pytest.fixture(name="foo_command")
def foo_command_fixture() -> FooCommand:
return FooCommand()
@pytest.fixture(name="bar_command")
def bar_command_fixture() -> BarCommand:
return BarCommand()