chore: improve DML check (#30417)

This commit is contained in:
Beto Dealmeida
2024-09-27 15:26:36 -04:00
committed by GitHub
parent 96b0bcfd78
commit cc9fd88c0d
6 changed files with 43 additions and 12 deletions

View File

@@ -918,3 +918,17 @@ def test_has_mutation(engine: str, sql: str, expected: bool) -> None:
Test the `has_mutation` method.
"""
assert SQLScript(sql, engine).has_mutation() == expected
def test_get_settings() -> None:
"""
Test `get_settings` in some edge cases.
"""
sql = """
set
-- this is a tricky comment
search_path -- another one
= bar;
SELECT * FROM some_table;
"""
assert SQLScript(sql, "postgresql").get_settings() == {"search_path": "bar"}