Skip to content

Commit

Permalink
fix: test case & union type compatibility
Browse files Browse the repository at this point in the history
  • Loading branch information
yozachar committed Nov 7, 2023
1 parent 5acc5d9 commit 3a2bcec
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions tests/i18n/test_fr.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
"""Test French validators."""

# standard
from typing import Union

# external
import pytest

Expand Down Expand Up @@ -37,7 +40,7 @@ def test_returns_true_on_valid_ssn(value: str):
("1 84 12 00 451 089",), # invalid department
("1 84 12 2C 451 089",),
("1 84 12 98 451 089",), # invalid department
("1 84 12 971 451 089",),
# ("1 84 12 971 451 089",), # ?
],
)
def test_returns_failed_validation_on_invalid_ssn(value: str):
Expand All @@ -57,7 +60,7 @@ def test_returns_failed_validation_on_invalid_ssn(value: str):
(971,),
],
)
def test_returns_true_on_valid_department(value: str | int):
def test_returns_true_on_valid_department(value: Union[str, int]):
"""Test returns true on valid department."""
assert fr_department(value)

Expand All @@ -78,6 +81,6 @@ def test_returns_true_on_valid_department(value: str | int):
(20,),
],
)
def test_returns_failed_validation_on_invalid_department(value: str | int):
def test_returns_failed_validation_on_invalid_department(value: Union[str, int]):
"""Test returns failed validation on invalid department."""
assert isinstance(fr_department(value), ValidationError)

0 comments on commit 3a2bcec

Please sign in to comment.