Skip to content

Commit

Permalink
Test refresh report writes query problems
Browse files Browse the repository at this point in the history
  • Loading branch information
JCZuurmond committed Sep 25, 2024
1 parent 733146e commit 04fa9d8
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 1 deletion.
2 changes: 1 addition & 1 deletion tests/unit/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -111,5 +111,5 @@ def mock_notebook_resolver():


@pytest.fixture
def mock_backend():
def mock_backend() -> MockBackend:
return MockBackend()
10 changes: 10 additions & 0 deletions tests/unit/source_code/test_queries.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,3 +33,13 @@ def test_query_linter_collects_dfsas_from_queries(name, query, dfsa_paths, is_re
assert set(dfsa.path for dfsa in dfsas) == set(dfsa_paths)
assert all(dfsa.is_read == is_read for dfsa in dfsas)
assert all(dfsa.is_write == is_write for dfsa in dfsas)


def test_query_liner_refresh_report_writes_query_problems(migration_index, mock_backend) -> None:
ws = create_autospec(WorkspaceClient)
crawlers = create_autospec(DirectFsAccessCrawler)
linter = QueryLinter(ws, migration_index, crawlers, None)

linter.refresh_report(mock_backend, inventory_database="test")

assert mock_backend.has_rows_written_for("`test`.query_problems")

0 comments on commit 04fa9d8

Please sign in to comment.