Skip to content

Commit

Permalink
Update unit tests
Browse files Browse the repository at this point in the history
  • Loading branch information
ThomasMeissnerDS committed Jan 14, 2025
1 parent 0fb7438 commit 72b3fef
Showing 1 changed file with 21 additions and 2 deletions.
23 changes: 21 additions & 2 deletions bluecast/tests/test_config_validations.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
from typing import Dict, Optional, Tuple

import pytest

from bluecast.config.config_validations import check_types_init
Expand All @@ -6,13 +8,30 @@
# Sample class to test the decorator
class TestClass:
@check_types_init
def __init__(self, a: int, b: str, c: list[int], d: dict[str, float]):
def __init__(
self,
a: int,
b: str,
c: list[int],
d: Optional[dict[str, float]] = None,
e: Optional[Tuple[str]] = None,
f: Optional[Dict[str, float]] = None,
):
self.a = a
self.b = b
self.c = c
self.d = d
self.e = e
self.f = f

Check warning on line 25 in bluecast/tests/test_config_validations.py

View check run for this annotation

Codecov / codecov/patch

bluecast/tests/test_config_validations.py#L20-L25

Added lines #L20 - L25 were not covered by tests


@pytest.fixture
def valid_instance():
return TestClass(1, "hello", [1, 2, 3], {"key1": 1.0, "key2": 2.5})
return TestClass(

Check warning on line 30 in bluecast/tests/test_config_validations.py

View check run for this annotation

Codecov / codecov/patch

bluecast/tests/test_config_validations.py#L30

Added line #L30 was not covered by tests
1,
"hello",
[1, 2, 3],
{"key1": 1.0, "key2": 2.5},
("a", "b"),
{"key1": 1.0, "key2": 2.5},
)

0 comments on commit 72b3fef

Please sign in to comment.