Skip to content

Commit 061c077

Browse files
Vaghinak BasentsyanVaghinak Basentsyan
authored andcommitted
Fixed tests
1 parent f5b56f4 commit 061c077

File tree

3 files changed

+7
-14
lines changed

3 files changed

+7
-14
lines changed

src/superannotate/lib/app/interface/sdk_interface.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2078,15 +2078,15 @@ def move_image(
20782078
]:
20792079
raise AppException(LIMITED_FUNCTIONS[project["project"].project_type])
20802080

2081-
destination_project, destination_folder = extract_project_folder(
2081+
destination_project_name, destination_folder = extract_project_folder(
20822082
destination_project
20832083
)
20842084

20852085
img_bytes = get_image_bytes(project=source_project, image_name=image_name)
20862086
image_path = destination_folder + image_name
20872087

20882088
image_entity = controller.upload_image_to_s3(
2089-
project_name=destination_project, image_path=image_path, image_bytes=img_bytes
2089+
project_name=destination_project_name, image_path=image_path, image_bytes=img_bytes
20902090
).data
20912091

20922092
del img_bytes
@@ -2100,7 +2100,7 @@ def move_image(
21002100
image_entity.annotation_status_code = res.annotation_status_code
21012101

21022102
controller.attach_urls(
2103-
project_name=destination_project,
2103+
project_name=destination_project_name,
21042104
files=[image_entity],
21052105
folder_name=destination_folder,
21062106
)
@@ -2110,18 +2110,18 @@ def move_image(
21102110
from_project_name=source_project_name,
21112111
from_folder_name=source_folder_name,
21122112
to_folder_name=destination_folder,
2113-
to_project_name=destination_project,
2113+
to_project_name=destination_project_name,
21142114
image_name=image_name,
21152115
)
21162116
if copy_pin:
21172117
controller.update_image(
2118-
project_name=destination_project,
2118+
project_name=destination_project_name,
21192119
folder_name=destination_folder,
21202120
image_name=image_name,
21212121
is_pinned=1,
21222122
)
21232123

2124-
controller.delete_image(image_name, source_project_name, source_folder_name)
2124+
controller.delete_image(source_project_name, image_name, source_folder_name)
21252125

21262126

21272127
@Trackable

tests/integration/test_depricated_functions_video.py

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -22,24 +22,18 @@ class TestDeprecatedFunctionsVideo(BaseTestCase):
2222
EXCEPTION_MESSAGE = LIMITED_FUNCTIONS[ProjectType.VIDEO.value]
2323
EXCEPTION_MESSAGE_DOCUMENT_VIDEO = DEPRICATED_DOCUMENT_VIDEO_MESSAGE
2424

25-
2625
def setUp(self, *args, **kwargs):
2726
self.tearDown()
28-
2927
sa.create_project(
3028
self.PROJECT_NAME, self.PROJECT_DESCRIPTION, self.PROJECT_TYPE
3129
)
32-
3330
sa.create_project(
3431
self.PROJECT_NAME_2, self.PROJECT_DESCRIPTION_2, self.PROJECT_TYPE_2
3532
)
3633

3734
def tearDown(self) -> None:
3835
projects = sa.search_projects(self.PROJECT_NAME, return_metadata=True)
39-
for project in projects:
40-
sa.delete_project(project)
41-
42-
projects = sa.search_projects(self.PROJECT_NAME_2, return_metadata=True)
36+
projects.extend(sa.search_projects(self.PROJECT_NAME_2, return_metadata=True))
4337
for project in projects:
4438
sa.delete_project(project)
4539

tests/integration/test_image_copy_move.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -151,7 +151,6 @@ def test_image_move(self):
151151
with self.assertRaises(Exception):
152152
sa.move_image(self.PROJECT_NAME, self.EXAMPLE_IMAGE, f"{self.PROJECT_NAME}")
153153

154-
sa.create_project(self.SECOND_PROJECT_NAME + "dif", "test", "Vector")
155154
sa.move_image(self.PROJECT_NAME, self.EXAMPLE_IMAGE, self.SECOND_PROJECT_NAME)
156155
di = sa.search_images(self.SECOND_PROJECT_NAME, self.EXAMPLE_IMAGE)
157156
self.assertEqual(len(di), 1)

0 commit comments

Comments
 (0)