Skip to content

Commit 7f65e70

Browse files
committed
pin image fix
1 parent 9485dc2 commit 7f65e70

File tree

2 files changed

+9
-3
lines changed

2 files changed

+9
-3
lines changed

pytest.ini

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,4 +3,4 @@ minversion = 3.7
33
log_cli=true
44
python_files = test_*.py
55
;pytest_plugins = ['pytest_profiling']
6-
addopts = -n auto --dist=loadscope
6+
;addopts = -n auto --dist=loadscope

tests/integration/test_basic_images.py

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,9 @@
66
import pytest
77

88
from src.superannotate import SAClient
9+
from tests.integration.base import BaseTestCase
910

1011
sa = SAClient()
11-
from tests.integration.base import BaseTestCase
1212

1313

1414
class TestVectorAnnotationsWithTag(BaseTestCase):
@@ -44,7 +44,13 @@ def test_vector_annotations_with_tag(self):
4444
self.assertEqual(annotations['instances'][0]['attributes'][0]['groupName'], 'g1')
4545
sa.pin_image(self.PROJECT_NAME, self.EXAMPLE_IMAGE_1, pin=True)
4646
metadata = sa.get_item_metadata(self.PROJECT_NAME, item_name=self.EXAMPLE_IMAGE_1)
47-
assert metadata['is_pinned'] == True
47+
assert metadata['is_pinned'] is True
48+
49+
def test_pin_image_negative_name(self):
50+
sa.attach_items(self.PROJECT_NAME, [{"url": "some url", "name": self.EXAMPLE_IMAGE_1}])
51+
item = sa.search_items(self.PROJECT_NAME)[0]
52+
assert not item['is_pinned']
53+
sa.pin_image(self.PROJECT_NAME, self.EXAMPLE_IMAGE_1 + 'NEW NAME')
4854

4955

5056
class TestVectorAnnotationsWithTagFolderUpload(BaseTestCase):

0 commit comments

Comments
 (0)