Skip to content

Commit

Permalink
test: check validation function of PlaneEmissionParameters
Browse files Browse the repository at this point in the history
  • Loading branch information
redfrexx committed May 4, 2024
1 parent 83333a0 commit 7e1eee5
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions tests/unit/test_parameters.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""Test pydantic models in parameters.py"""

from co2calculator import TransportationMode
from co2calculator.parameters import PlaneEmissionParameters
import pytest
from pydantic import ValidationError


def test_planeemissionparameter_raise_validation_error():
"""Tests that PlaneEmissionParameters raises a validation error when an invalid seating is provided."""
with pytest.raises(ValidationError):
PlaneEmissionParameters(subcategory=TransportationMode.PLANE, seating="INVALID")

0 comments on commit 7e1eee5

Please sign in to comment.