chore: code clean-up
This commit is contained in:
parent
5388c71ee1
commit
0d61f433c6
1 changed files with 5 additions and 8 deletions
|
|
@ -17,12 +17,12 @@ class EventFixture(BaseModel):
|
||||||
|
|
||||||
@pytest.fixture
|
@pytest.fixture
|
||||||
def valid_events() -> List[EventFixture]:
|
def valid_events() -> List[EventFixture]:
|
||||||
data = get_fixture("events")
|
data = get_fixtures("events")
|
||||||
return [EventFixture.parse_obj(e) for e in data["valid"]]
|
return [EventFixture.parse_obj(e) for e in data["valid"]]
|
||||||
|
|
||||||
@pytest.fixture
|
@pytest.fixture
|
||||||
def invalid_events() -> List[EventFixture]:
|
def invalid_events() -> List[EventFixture]:
|
||||||
data = get_fixture("events")
|
data = get_fixtures("events")
|
||||||
return [EventFixture.parse_obj(e) for e in data["invalid"]]
|
return [EventFixture.parse_obj(e) for e in data["invalid"]]
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -36,15 +36,12 @@ def test_event_id_and_signature_ok(valid_events: List[EventFixture]):
|
||||||
|
|
||||||
def test_event_id_and_signature_invalid(invalid_events: List[EventFixture]):
|
def test_event_id_and_signature_invalid(invalid_events: List[EventFixture]):
|
||||||
for f in invalid_events:
|
for f in invalid_events:
|
||||||
print("### test_event_id_and_signature_invalid", f.name)
|
with pytest.raises(ValueError, match=f.exception):
|
||||||
with pytest.raises(ValueError, match=f.exception) as e_info:
|
|
||||||
print("### e.info", e_info)
|
|
||||||
f.data.check_signature()
|
f.data.check_signature()
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
def get_fixtures(file):
|
||||||
def get_fixture(file):
|
|
||||||
"""
|
"""
|
||||||
Read the content of the JSON file.
|
Read the content of the JSON file.
|
||||||
"""
|
"""
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue