Skip to content

Commit

Permalink
fix tests for rx.image
Browse files Browse the repository at this point in the history
  • Loading branch information
Lendemor committed Oct 4, 2023
1 parent 6377d66 commit 9a63e1b
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions tests/components/media/test_image.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ def test_serialize_image(pil_image: Img):
def test_set_src_str():
"""Test that setting the src works."""
image = rx.image(src="pic2.jpeg")
assert str(image.src) == "pic2.jpeg" # type: ignore
assert str(image.src) == "{`pic2.jpeg`}" # type: ignore

def test_set_src_img(pil_image: Img):
"""Test that setting the src works.
Expand All @@ -43,7 +43,7 @@ def test_set_src_img(pil_image: Img):
pil_image: The image to serialize.
"""
image = Image.create(src=pil_image)
assert str(image.src) == serialize_image(pil_image) # type: ignore
assert str(image.src.name) == serialize_image(pil_image) # type: ignore

def test_render(pil_image: Img):
"""Test that rendering an image works.
Expand All @@ -52,8 +52,6 @@ def test_render(pil_image: Img):
pil_image: The image to serialize.
"""
image = Image.create(src=pil_image)
assert not image.src.is_string # type: ignore
image._render()
assert image.src.is_string # type: ignore

except ImportError:
Expand Down

0 comments on commit 9a63e1b

Please sign in to comment.