Skip to content

Commit

Permalink
add default values for float properties in model registry and rename …
Browse files Browse the repository at this point in the history
…fuzz test method
  • Loading branch information
cleder committed Dec 1, 2024
1 parent e7e781e commit 31aa4dc
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
8 changes: 8 additions & 0 deletions fastkml/model.py
Original file line number Diff line number Diff line change
Expand Up @@ -135,6 +135,7 @@ def geometry(self) -> Optional[Point]:
classes=(float,),
get_kwarg=subelement_float_kwarg,
set_element=float_subelement,
default=0.0,
),
)

Expand Down Expand Up @@ -192,6 +193,7 @@ def __repr__(self) -> str:
classes=(float,),
get_kwarg=subelement_float_kwarg,
set_element=float_subelement,
default=0.0,
),
)
registry.register(
Expand All @@ -203,6 +205,7 @@ def __repr__(self) -> str:
classes=(float,),
get_kwarg=subelement_float_kwarg,
set_element=float_subelement,
default=0.0,
),
)
registry.register(
Expand All @@ -214,6 +217,7 @@ def __repr__(self) -> str:
classes=(float,),
get_kwarg=subelement_float_kwarg,
set_element=float_subelement,
default=0.0,
),
)

Expand Down Expand Up @@ -269,6 +273,7 @@ def __repr__(self) -> str:
classes=(float,),
get_kwarg=subelement_float_kwarg,
set_element=float_subelement,
default=1.0,
),
)
registry.register(
Expand All @@ -280,6 +285,7 @@ def __repr__(self) -> str:
classes=(float,),
get_kwarg=subelement_float_kwarg,
set_element=float_subelement,
default=1.0,
),
)
registry.register(
Expand All @@ -291,6 +297,7 @@ def __repr__(self) -> str:
classes=(float,),
get_kwarg=subelement_float_kwarg,
set_element=float_subelement,
default=1.0,
),
)

Expand Down Expand Up @@ -480,6 +487,7 @@ def geometry(self) -> Optional[Point]:
classes=(AltitudeMode,),
get_kwarg=subelement_enum_kwarg,
set_element=enum_subelement,
default=AltitudeMode.clamp_to_ground,
),
)
registry.register(
Expand Down
2 changes: 1 addition & 1 deletion tests/hypothesis/feature_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -445,7 +445,7 @@ def test_fuzz_placemark_styles(
link=st.builds(fastkml.Link, href=urls()),
),
)
def fuzz_placemark_model(
def test_fuzz_placemark_model(
self,
model: fastkml.model.Model,
) -> None:
Expand Down

0 comments on commit 31aa4dc

Please sign in to comment.