Skip to content

Commit

Permalink
Add deserialization test
Browse files Browse the repository at this point in the history
  • Loading branch information
rhaps0dy committed May 10, 2024
1 parent d178c85 commit d54db1c
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 0 deletions.
5 changes: 5 additions & 0 deletions .changelog/_unreleased.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
[[entries]]
id = "6d0f41f2-f7f9-4808-af65-196a7a909b4f"
type = "fix"
description = "Fix #47: Union with Literal in them can now de/serialize"
author = "@rhaps0dy"
6 changes: 6 additions & 0 deletions databind/src/databind/json/tests/converters_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -726,3 +726,9 @@ def test_union_literal():

assert mapper.serialize("bye", StrType) == "bye"
assert mapper.serialize("other", StrType) == "other"

assert mapper.deserialize("hi", IntType) == "hi"
assert mapper.deserialize(2, IntType) == 2

assert mapper.deserialize("bye", StrType) == "bye"
assert mapper.deserialize("other", StrType) == "other"

0 comments on commit d54db1c

Please sign in to comment.