Skip to content
This repository has been archived by the owner on Dec 16, 2024. It is now read-only.

Commit

Permalink
Add unit test for Ellipsoid and reference attribute of Position
Browse files Browse the repository at this point in the history
  • Loading branch information
Joris Olympio committed Apr 12, 2020
1 parent 403403f commit 53a8e6d
Showing 1 changed file with 30 additions and 0 deletions.
30 changes: 30 additions & 0 deletions tests/test_properties.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@
ClassificationType,
Color,
DistanceDisplayCondition,
Ellipsoid,
EllipsoidRadii,
EyeOffset,
GridMaterial,
ImageMaterial,
Expand Down Expand Up @@ -364,6 +366,15 @@ def test_position_cartographic_degrees():
assert repr(pos) == expected_result


def test_position_reference():
expected_result = """{
"reference": "satellite"
}"""
pos = Position(reference="satellite")

assert repr(pos) == expected_result


def test_single_interval_value():
expected_result = """{
"interval": "2019-01-01T00:00:00Z/2019-01-02T00:00:00Z",
Expand Down Expand Up @@ -436,3 +447,22 @@ def test_bad_uri_raises_error():
Uri(uri="a")

assert "uri must be a URL or a data URI" in excinfo.exconly()


def test_ellisoid():
expected_result = """{
"radii": {
"cartesian": [
20.0,
30.0,
40.0
]
},
"fill": false,
"outline": true
}"""

ell = Ellipsoid(
radii=EllipsoidRadii(cartesian=[20.0, 30.0, 40.0]), fill=False, outline=True
)
assert repr(ell) == expected_result

0 comments on commit 53a8e6d

Please sign in to comment.