Skip to content

Commit 15b8b47

Browse files
committed
Update tests
1 parent 9a9dac6 commit 15b8b47

File tree

1 file changed

+14
-8
lines changed

1 file changed

+14
-8
lines changed

tests/catalog/test_rest.py

Lines changed: 14 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1289,22 +1289,28 @@ def test_catalog_from_parameters_empty_env(rest_mock: Mocker) -> None:
12891289
assert catalog.uri == "https://other-service.io/api"
12901290

12911291

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"
12981296
rest_mock.post(
12991297
url=f"{TEST_URI}v1/namespaces/namespace/tables/table_name",
13001298
json={
13011299
"metadata": example_table_metadata_v2,
1302-
"metadata-location": "test",
1300+
"metadata-location": metadata_location,
13031301
},
13041302
status_code=200,
13051303
request_headers=TEST_HEADERS,
13061304
)
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, (), ())
13081314
assert (
13091315
rest_mock.last_request.text
13101316
== """{"identifier":{"namespace":["namespace"],"name":"table_name"},"requirements":[],"updates":[]}"""

0 commit comments

Comments
 (0)