Skip to content

Commit 27f9f3b

Browse files
Vaghinak BasentsyanVaghinak Basentsyan
authored andcommitted
Added annotation_status validaton
1 parent e551218 commit 27f9f3b

File tree

5 files changed

+18
-8
lines changed

5 files changed

+18
-8
lines changed

pytest.ini

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,4 @@
22
minversion = 3.0
33
log_cli=true
44
python_files = test_*.py
5-
;addopts = -n32 --dist=loadscope
5+
addopts = -n32 --dist=loadscope

src/superannotate/lib/core/enums.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,10 @@ def get_value(cls, name):
2323
if enum.name.lower() == name.lower():
2424
return enum.value
2525

26+
@classmethod
27+
def values(cls):
28+
return [enum.name.lower() for enum in list(cls)]
29+
2630

2731
class ProjectType(BaseTitledEnum):
2832
VECTOR = "Vector", 1

src/superannotate/lib/core/usecases.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4301,6 +4301,10 @@ def exclude_file_patterns(self):
43014301
return constances.DEFAULT_FILE_EXCLUDE_PATTERNS
43024302
return self._exclude_file_patterns
43034303

4304+
def validate_annotation_status(self):
4305+
if self._annotation_status and self._annotation_status not in constances.AnnotationStatus.values():
4306+
raise AppValidationException("Invalid annotations status")
4307+
43044308
def validate_extensions(self):
43054309
if self._extensions and not all(
43064310
[extension in constances.DEFAULT_IMAGE_EXTENSIONS for extension in self._extensions]

tests/integration/test_annotation_delete.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -26,9 +26,9 @@ def classes_json(self):
2626
"data_set/sample_project_vector/classes/classes.json",
2727
)
2828

29-
# @pytest.mark.skip(
30-
# "waiting for deployment to dev",
31-
# )
29+
@pytest.mark.skip(
30+
"waiting for deployment to dev",
31+
)
3232
def test_delete_annotations(self):
3333
sa.upload_images_from_folder_to_project(
3434
self.PROJECT_NAME, self.folder_path, annotation_status="InProgress"
@@ -46,9 +46,9 @@ def test_delete_annotations(self):
4646
self.assertIsNotNone(data["annotation_json_filename"])
4747
self.assertIsNone(data["annotation_mask"])
4848

49-
# @pytest.mark.skip(
50-
# "waiting for deployment to dev",
51-
# )
49+
@pytest.mark.skip(
50+
"waiting for deployment to dev",
51+
)
5252
def test_delete_annotations_by_not_existing_name(self):
5353
sa.upload_images_from_folder_to_project(
5454
self.PROJECT_NAME, self.folder_path, annotation_status="InProgress"

tests/profiling/profiling.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,4 +45,6 @@
4545
# print(results)
4646
# print(sum(results)/9)
4747

48-
print(sa.search_images("Vector/for sdk"))
48+
from src.superannotate.lib.core.enums import AnnotationStatus
49+
50+
pass

0 commit comments

Comments
 (0)