Skip to content

Commit

Permalink
Increase test coverage
Browse files Browse the repository at this point in the history
  • Loading branch information
natemcmaster committed Jun 18, 2021
1 parent d2ba3d7 commit 82d4ffd
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions tests/test_structure_attrs.py
Original file line number Diff line number Diff line change
Expand Up @@ -217,16 +217,21 @@ def test_structure_prefers_attrib_converters(converter_type):
# attribute without type
"x": attrib(converter=attrib_converter),
# built-in types converters
"z": attrib(type=int, converter=attrib_converter),
"y": attrib(type=int, converter=attrib_converter),
# attribute with type and default value
"z": attrib(type=int, converter=attrib_converter, default=5),
},
)

inst = converter.structure(dict(ip="10.0.0.0", x=1, z=3), cl)
inst = converter.structure(dict(ip="10.0.0.0", x=1, y=3), cl)

assert inst.ip == IPv4Address("10.0.0.0")

attrib_converter.assert_any_call(1)
assert inst.x == "1"

attrib_converter.assert_any_call(3)
assert inst.z == "3"
assert inst.y == "3"

attrib_converter.assert_any_call(5)
assert inst.z == "5"

0 comments on commit 82d4ffd

Please sign in to comment.