Skip to content

Commit 2977ad7

Browse files
committed
Add unit test for creating UCX history schema and table
1 parent e7059c8 commit 2977ad7

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

tests/unit/test_cli.py

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -894,6 +894,15 @@ def test_create_ucx_catalog_calls_create_catalog(ws) -> None:
894894
ws.catalogs.create.assert_called_once()
895895

896896

897+
def test_create_ucx_catalog_creates_history_schema_and_table(ws, mock_backend) -> None:
898+
prompts = MockPrompts({"Please provide storage location url for catalog: .*": "metastore"})
899+
900+
create_ucx_catalog(ws, prompts, ctx=WorkspaceContext(ws).replace(sql_backend=mock_backend))
901+
902+
assert "CREATE SCHEMA" in mock_backend.queries[0]
903+
assert "CREATE TABLE" in mock_backend.queries[1]
904+
905+
897906
@pytest.mark.parametrize("run_as_collection", [False, True])
898907
def test_migrate_tables_calls_migrate_table_job_run_now(
899908
run_as_collection,

0 commit comments

Comments
 (0)