Skip to content

Commit 7a99c5c

Browse files
committed
Add test case for unsupported serialization
1 parent 25137cb commit 7a99c5c

File tree

2 files changed

+6
-1
lines changed

2 files changed

+6
-1
lines changed

src/undate/converters/combined.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,4 +82,4 @@ def parse(self, value: str) -> Union[Undate, UndateInterval]:
8282

8383
def to_string(self, undate: Union[Undate, UndateInterval]) -> str:
8484
"Not supported by this converter. Will raise :class:`ValueError`"
85-
raise ValueError("Omnibus supporter does not support serialization")
85+
raise ValueError("Omnibus converter does not support serialization")

tests/test_converters/test_combined_parser.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,3 +38,8 @@ def test_transform(date_string, expected):
3838
def test_converter(date_string, expected):
3939
# should work the same way when called through the converter class
4040
assert repr(Undate.parse(date_string, "omnibus")) == repr(expected)
41+
42+
43+
def test_no_serialize():
44+
with pytest.raises(ValueError, match="does not support"):
45+
Undate("2022").format("omnibus")

0 commit comments

Comments
 (0)