Skip to content

Commit a82ec0a

Browse files
committed
fix: add missing content_type="application/json" to API test responses
1 parent f71389c commit a82ec0a

File tree

3 files changed

+24
-5
lines changed

3 files changed

+24
-5
lines changed

tests/test_custom_metadata_fields_ops.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -392,6 +392,7 @@ def test_create_custom_metadata_fields_succeeds_with_type_number(self):
392392
url,
393393
status=201,
394394
headers=headers,
395+
content_type="application/json",
395396
body="""{
396397
"id": "62dfc03b1b02a58936efca37",
397398
"name": "test",
@@ -464,6 +465,7 @@ def test_create_custom_metadata_fields_succeeds_with_type_textarea(self):
464465
url,
465466
status=201,
466467
headers=headers,
468+
content_type="application/json",
467469
body="""{
468470
"id": "62e0d7ae1b02a589360dc1fd",
469471
"name": "test",
@@ -550,6 +552,7 @@ def test_create_custom_metadata_fields_succeeds_with_type_date(self):
550552
url,
551553
status=201,
552554
headers=headers,
555+
content_type="application/json",
553556
body="""{
554557
"id": "62dfc9f41b02a58936f0d284",
555558
"name": "test-date",
@@ -628,6 +631,7 @@ def test_create_custom_metadata_fields_succeeds_with_type_boolean(self):
628631
url,
629632
status=201,
630633
headers=headers,
634+
content_type="application/json",
631635
body="""{
632636
"id": "62dfcb801b02a58936f0fc39",
633637
"name": "test-boolean",
@@ -706,6 +710,7 @@ def test_create_custom_metadata_fields_succeeds_with_type_single_select(self):
706710
url,
707711
status=201,
708712
headers=headers,
713+
content_type="application/json",
709714
body="""{
710715
"id": "62dfcdb21b02a58936f14c97",
711716
"name": "test",
@@ -782,6 +787,7 @@ def test_create_custom_metadata_fields_succeeds_with_type_multi_select(self):
782787
url,
783788
status=201,
784789
headers=headers,
790+
content_type="application/json",
785791
body="""{
786792
"id": "62dfcf001b02a58936f17808",
787793
"name": "test",
@@ -863,6 +869,7 @@ def test_update_custom_metadata_fields_succeeds(self):
863869
responses.PATCH,
864870
url,
865871
headers=headers,
872+
content_type="application/json",
866873
body="""{
867874
"id": "62a9d5f6db485107347bb7f2",
868875
"name": "test",

tests/test_files_ops.py

Lines changed: 14 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1163,6 +1163,7 @@ def test_bulk_file_delete_succeeds(self):
11631163
url,
11641164
body='{"successfullyDeletedFileIds": ["fake_123", "fake_222"]}',
11651165
headers=headers,
1166+
content_type="application/json",
11661167
)
11671168

11681169
resp = self.client.bulk_file_delete(self.bulk_delete_ids)
@@ -1204,6 +1205,7 @@ def test_bulk_file_delete_succeeds_and_recieves_extra_non_breaking_changes_from_
12041205
url,
12051206
body='{"successfullyDeletedFileIds": ["fake_123"],"nonDeletedFields":["fake_222"]}',
12061207
headers=headers,
1208+
content_type="application/json",
12071209
)
12081210

12091211
resp = self.client.bulk_file_delete(self.bulk_delete_ids)
@@ -1298,7 +1300,7 @@ def test_file_delete_succeeds(self):
12981300
headers = {"Content-Type": "application/json"}
12991301
headers.update(get_auth_headers_for_test())
13001302

1301-
responses.add(responses.DELETE, url , status=204, headers=headers)
1303+
responses.add(responses.DELETE, url , status=204, headers=headers, content_type="application/json")
13021304

13031305
resp = self.client.delete_file(self.file_id)
13041306

@@ -1659,6 +1661,7 @@ def test_update_file_details_succeeds_with_id(self):
16591661
responses.add(
16601662
responses.PATCH,
16611663
url,
1664+
content_type="application/json",
16621665
body="""{
16631666
"type": "file",
16641667
"name": "default-image.jpg",
@@ -1820,6 +1823,7 @@ def test_update_file_publish_status_succeeds_(self):
18201823
responses.add(
18211824
responses.PATCH,
18221825
url,
1826+
content_type="application/json",
18231827
body="""{
18241828
"type": "file",
18251829
"name": "default-image.jpg",
@@ -2033,6 +2037,7 @@ def test_get_file_versions_succeeds_with_id(self):
20332037
responses.add(
20342038
responses.GET,
20352039
url,
2040+
content_type="application/json",
20362041
body="""[{
20372042
"type": "file",
20382043
"name": "new_car.jpg",
@@ -2334,6 +2339,7 @@ def test_get_file_version_details_succeeds_with_id(self):
23342339
"mime": "image/jpeg"
23352340
}""",
23362341
headers=headers,
2342+
content_type="application/json",
23372343
)
23382344
resp = self.client.get_file_version_details(self.file_id, self.version_id)
23392345
mock_response_metadata = {
@@ -2466,7 +2472,7 @@ def test_delete_file_version_succeeds(self) -> None:
24662472
)
24672473
headers = {"Content-Type": "application/json"}
24682474
headers.update(create_headers_for_test())
2469-
responses.add(responses.DELETE, url, status=204, headers=headers )
2475+
responses.add(responses.DELETE, url, status=204, headers=headers, content_type="application/json")
24702476
resp = self.client.delete_file_version(self.file_id, self.version_id)
24712477

24722478
mock_response_metadata = {
@@ -2534,7 +2540,7 @@ def test_copy_file_succeeds(self) -> None:
25342540
url = "{}/v1/files/copy".format(URL.API_BASE_URL)
25352541
headers = {"Content-Type": "application/json"}
25362542
headers.update(create_headers_for_test())
2537-
responses.add(responses.POST, url, status=204, headers=headers)
2543+
responses.add(responses.POST, url, status=204, headers=headers, content_type="application/json")
25382544

25392545
resp = self.client.copy_file(
25402546
options=CopyFileRequestOptions(
@@ -2581,7 +2587,7 @@ def test_copy_file_succeeds_without_include_file_versions(self) -> None:
25812587
url = "{}/v1/files/copy".format(URL.API_BASE_URL)
25822588
headers = {"Content-Type": "application/json"}
25832589
headers.update(create_headers_for_test())
2584-
responses.add(responses.POST, url, status=204, headers=headers )
2590+
responses.add(responses.POST, url, status=204, headers=headers, content_type="application/json")
25852591

25862592
resp = self.client.copy_file(
25872593
options=CopyFileRequestOptions(
@@ -2663,7 +2669,7 @@ def test_move_file_succeeds(self) -> None:
26632669
url = "{}/v1/files/move".format(URL.API_BASE_URL)
26642670
headers = {"Content-Type": "application/json"}
26652671
headers.update(create_headers_for_test())
2666-
responses.add(responses.POST, url, status=204, headers=headers )
2672+
responses.add(responses.POST, url, status=204, headers=headers, content_type="application/json")
26672673

26682674
resp = self.client.move_file(
26692675
options=MoveFileRequestOptions(
@@ -2752,6 +2758,7 @@ def test_rename_file_succeeds_with_purge_cache_false(self) -> None:
27522758
url,
27532759
headers=headers,
27542760
body="{}",
2761+
content_type="application/json",
27552762
)
27562763
resp = self.client.rename_file(
27572764
options=RenameFileRequestOptions(
@@ -2804,6 +2811,7 @@ def test_rename_file_succeeds_with_purge_cache(self) -> None:
28042811
url,
28052812
headers=headers,
28062813
body='{"purgeRequestId": "62de3e986f68334a5a3339fb"}',
2814+
content_type="application/json",
28072815
)
28082816
resp = self.client.rename_file(
28092817
options=RenameFileRequestOptions(
@@ -2927,6 +2935,7 @@ def test_restore_file_version_succeeds(self) -> None:
29272935
responses.PUT,
29282936
url,
29292937
headers=headers,
2938+
content_type="application/json",
29302939
body="""{
29312940
"fileId": "fileId",
29322941
"type": "file",

tests/test_tags_ops.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,7 @@ def test_add_tags_succeeds(self):
6666
url,
6767
body='{"successfullyUpdatedFileIds": ["fake_123"]}',
6868
headers=headers,
69+
content_type="application/json",
6970
)
7071

7172
resp = self.client.add_tags(
@@ -163,6 +164,7 @@ def test_remove_tags_succeeds(self):
163164
url,
164165
body='{"successfullyUpdatedFileIds": ["fake_123"]}',
165166
headers=headers,
167+
content_type="application/json",
166168
)
167169

168170
resp = self.client.remove_tags(
@@ -273,6 +275,7 @@ def test_remove_ai_tags_succeeds(self):
273275
url,
274276
body='{"successfullyUpdatedFileIds": ["fake_123"]}',
275277
headers=headers,
278+
content_type="application/json",
276279
)
277280

278281
resp = self.client.remove_ai_tags(

0 commit comments

Comments
 (0)