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

Commit

Permalink
Add test_material_image_uri()
Browse files Browse the repository at this point in the history
  • Loading branch information
Daniel Stoops committed Nov 26, 2024
1 parent 8c05619 commit 0a034b0
Showing 1 changed file with 31 additions and 0 deletions.
31 changes: 31 additions & 0 deletions tests/test_properties.py
Original file line number Diff line number Diff line change
Expand Up @@ -431,6 +431,37 @@ def test_material_image():
)
assert str(mat) == expected_result


def test_material_image_uri():
expected_result = """{
"image": {
"image": "data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7",
"repeat": [
2,
2
],
"color": {
"rgba": [
200,
100,
30,
255
]
}
}
}"""

mat = Material(
image=ImageMaterial(
image=Uri(
uri="""data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7"""
),
repeat=[2, 2],
color=Color(rgba=[200, 100, 30]),
)
)
assert str(mat) == expected_result

pol_mat = PolylineMaterial(
image=ImageMaterial(
image=Uri(uri="https://site.com/image.png"),
Expand Down

0 comments on commit 0a034b0

Please sign in to comment.