Skip to content

Commit f1ed096

Browse files
committed
tests
1 parent b85cf50 commit f1ed096

File tree

1 file changed

+8
-5
lines changed

1 file changed

+8
-5
lines changed

tests/integration/annotations/test_annotation_upload_pixel.py

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ class TestRecursiveFolderPixel(BaseTestCase):
1818
S3_FOLDER_PATH = "sample_project_pixel"
1919
TEST_FOLDER_PATH = "data_set/sample_project_pixel"
2020
IMAGE_NAME = "example_image_1.jpg"
21+
FOLDER = "f"
2122

2223

2324
@pytest.fixture(autouse=True)
@@ -31,23 +32,25 @@ def folder_path(self):
3132
@pytest.mark.flaky(reruns=2)
3233
@patch("lib.core.usecases.annotations.UploadAnnotationUseCase.s3_bucket")
3334
def test_recursive_annotation_upload_pixel(self, s3_bucket):
35+
sa.create_folder(self.PROJECT_NAME,self.FOLDER)
36+
destination = f"{self.PROJECT_NAME}/{self.FOLDER}"
3437
sa.upload_images_from_folder_to_project(
35-
self.PROJECT_NAME, self.folder_path, recursive_subfolders=False
38+
destination, self.folder_path, recursive_subfolders=False
3639
)
37-
uploaded_annotations, _, _ = sa.upload_annotations_from_folder_to_project(self.PROJECT_NAME,
40+
uploaded_annotations, _, _ = sa.upload_annotations_from_folder_to_project(destination,
3841
self.S3_FOLDER_PATH,
3942
from_s3_bucket="superannotate-python-sdk-test",
4043
recursive_subfolders=False)
4144
self.assertEqual(len(uploaded_annotations), 3)
4245
self.assertEqual(len(s3_bucket.method_calls), 6)
43-
self.assertIn(f"Uploading 3 annotations from {self.S3_FOLDER_PATH} to the project {self.PROJECT_NAME}.", self._caplog.text)
46+
self.assertIn(f"Uploading 3 annotations from {self.S3_FOLDER_PATH} to the project {destination}.", self._caplog.text)
4447

45-
uploaded_annotations, _, _ = sa.upload_preannotations_from_folder_to_project(self.PROJECT_NAME,
48+
uploaded_annotations, _, _ = sa.upload_preannotations_from_folder_to_project(destination,
4649
self.S3_FOLDER_PATH,
4750
from_s3_bucket="superannotate-python-sdk-test",
4851
recursive_subfolders=False)
4952
self.assertEqual(len(s3_bucket.method_calls), 12)
50-
self.assertIn(f"Uploading 3 annotations from {self.S3_FOLDER_PATH} to the project {self.PROJECT_NAME}.",
53+
self.assertIn(f"Uploading 3 annotations from {self.S3_FOLDER_PATH} to the project {destination}.",
5154
self._caplog.text)
5255

5356

0 commit comments

Comments
 (0)