def test_view_file_valid(self, tmp_query_path): view_file = tmp_query_path / "view.sql" view_file.write_text( """ SELECT * FROM `moz-fx-data-shared-prod.telemetry_derived.clients_daily_v6` """ ) # this view file is only valid with strip_dml flag dryrun = DryRun(sqlfile=str(view_file), strip_dml=True) assert dryrun.get_error() is Errors.DATE_FILTER_NEEDED assert dryrun.is_valid()
def test_sql_file_invalid(self, tmp_path): query_file = tmp_path / "query.sql" query_file.write_text("SELECT INVALID 123") dryrun = DryRun(str(query_file)) assert dryrun.is_valid() is False