@@ -1289,22 +1289,28 @@ def test_catalog_from_parameters_empty_env(rest_mock: Mocker) -> None:
1289
1289
assert catalog .uri == "https://other-service.io/api"
1290
1290
1291
1291
1292
- def test_table_identifier_in_commit_table_request (rest_mock : Mocker , example_table_metadata_v2 : Dict [str , Any ]) -> None :
1293
- test_table_request = CommitTableRequest (
1294
- identifier = TableIdentifier (namespace = ("catalog_name" , "namespace" ), name = "table_name" ),
1295
- updates = [],
1296
- requirements = [],
1297
- )
1292
+ def test_table_identifier_in_commit_table_request (
1293
+ rest_mock : Mocker , table_schema_simple : Schema , example_table_metadata_v2 : Dict [str , Any ]
1294
+ ) -> None :
1295
+ metadata_location = "s3://some_bucket/metadata.json"
1298
1296
rest_mock .post (
1299
1297
url = f"{ TEST_URI } v1/namespaces/namespace/tables/table_name" ,
1300
1298
json = {
1301
1299
"metadata" : example_table_metadata_v2 ,
1302
- "metadata-location" : "test" ,
1300
+ "metadata-location" : metadata_location ,
1303
1301
},
1304
1302
status_code = 200 ,
1305
1303
request_headers = TEST_HEADERS ,
1306
1304
)
1307
- RestCatalog ("catalog_name" , uri = TEST_URI , token = TEST_TOKEN )._commit_table (test_table_request )
1305
+ catalog = RestCatalog ("catalog_name" , uri = TEST_URI , token = TEST_TOKEN )
1306
+ table = Table (
1307
+ identifier = ("namespace" , "table_name" ),
1308
+ metadata = None , # type: ignore
1309
+ metadata_location = metadata_location ,
1310
+ io = None , # type: ignore
1311
+ catalog = catalog ,
1312
+ )
1313
+ catalog .commit_table (table , (), ())
1308
1314
assert (
1309
1315
rest_mock .last_request .text
1310
1316
== """{"identifier":{"namespace":["namespace"],"name":"table_name"},"requirements":[],"updates":[]}"""
0 commit comments