Skip to content
Snippets Groups Projects
Verified Commit 7961895b authored by Yoann Schneider's avatar Yoann Schneider :tennis:
Browse files

add parallel test case on cached elements

parent a52cbd99
No related branches found
No related tags found
1 merge request!234Add element polygon shortcut as a property
Pipeline #79700 passed
......@@ -2,6 +2,7 @@
import pytest
from requests import HTTPError
from arkindex_worker.cache import CachedElement
from arkindex_worker.models import Element
......@@ -405,10 +406,11 @@ def test_setattr_setitem():
def test_element_polygon():
element = Element(
{"zone": {"polygon": [[0, 0], [181, 0], [181, 240], [0, 240], [0, 0]]}}
)
assert element.polygon == [[0, 0], [181, 0], [181, 240], [0, 240], [0, 0]]
polygon = [[0, 0], [181, 0], [181, 240], [0, 240], [0, 0]]
element = Element({"zone": {"polygon": polygon}})
cached_element = CachedElement(polygon=polygon)
assert element.polygon == polygon
assert element.polygon == cached_element.polygon
def test_element_no_polygon():
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment