Add test data

This commit is contained in:
Joachim Jablon
2021-07-24 00:06:05 +02:00
parent 626fbd3669
commit 5e2905c070
6 changed files with 33 additions and 0 deletions

0
tests/__init__.py Normal file
View File

10
tests/code.py Normal file
View File

@@ -0,0 +1,10 @@
from typing import Optional
def code(arg: Optional[bool]) -> str:
if arg is None:
return "a"
elif arg is True:
return "b"
else:
return "c"

2
tests/requirements.txt Normal file
View File

@@ -0,0 +1,2 @@
pytest
pytest-cov

8
tests/test_code.py Normal file
View File

@@ -0,0 +1,8 @@
import pytest
from . import code
@pytest.mark.parametrize("arg, expected", [(None, "a")])
def test_code(arg, expected):
assert code.code(arg) == expected