|
6 | 6 |
|
7 | 7 | import superannotate as sa |
8 | 8 |
|
9 | | -sa.init(Path.home() / ".superannotate" / "config.json") |
10 | | - |
11 | 9 | TEST_PROJECT_NAME = "test_direct_s3_upload" |
12 | 10 | S3_BUCKET = 'superannotate-python-sdk-test' |
13 | 11 | S3_FOLDER = 'sample_project_vector' |
@@ -42,39 +40,3 @@ def test_direct_s3_upload(): |
42 | 40 | on_s3.append(key) |
43 | 41 |
|
44 | 42 | assert len(on_s3) == sa.get_project_image_count(project) |
45 | | - |
46 | | - |
47 | | -@pytest.mark.skipif( |
48 | | - "AO_TEST_LEVEL" not in os.environ or |
49 | | - os.environ["AO_TEST_LEVEL"] != "stress", |
50 | | - reason="Requires env variable to be set" |
51 | | -) |
52 | | -def test_direct_s3_upload_stress(): |
53 | | - projects_found = sa.search_projects( |
54 | | - TEST_PROJECT_NAME + " stress", return_metadata=True |
55 | | - ) |
56 | | - for pr in projects_found: |
57 | | - sa.delete_project(pr) |
58 | | - |
59 | | - project = sa.create_project(TEST_PROJECT_NAME + " stress", "a", "Vector") |
60 | | - |
61 | | - csv = (Path.home() / |
62 | | - "hovnatan_aws.csv").read_text().splitlines()[1].split(",") |
63 | | - |
64 | | - sa.upload_images_from_s3_bucket_to_project( |
65 | | - project, csv[2], csv[3], S3_BUCKET, S3_FOLDER_STRESS |
66 | | - ) |
67 | | - s3_client = boto3.client('s3') |
68 | | - paginator = s3_client.get_paginator('list_objects_v2') |
69 | | - response_iterator = paginator.paginate( |
70 | | - Bucket=S3_BUCKET, Prefix=S3_FOLDER_STRESS |
71 | | - ) |
72 | | - on_s3 = [] |
73 | | - for response in response_iterator: |
74 | | - if 'Contents' in response: |
75 | | - for object_data in response['Contents']: |
76 | | - key = object_data['Key'] |
77 | | - if key[-4:] == ".jpg": |
78 | | - on_s3.append(key) |
79 | | - |
80 | | - assert len(on_s3) == sa.get_project_image_count(project) |
0 commit comments