@@ -198,14 +198,6 @@ def test_duplicates(state_sync: EngineAdapterStateSync, make_snapshot: t.Callabl
198198 )
199199
200200
201- def test_delete_snapshots (state_sync : EngineAdapterStateSync , snapshots : t .List [Snapshot ]) -> None :
202- state_sync .push_snapshots (snapshots )
203- snapshot_ids = [s .snapshot_id for s in snapshots ]
204- assert state_sync .get_snapshots (snapshot_ids )
205- state_sync .delete_snapshots (snapshot_ids )
206- assert not state_sync .get_snapshots (snapshot_ids )
207-
208-
209201def test_snapshots_exists (state_sync : EngineAdapterStateSync , snapshots : t .List [Snapshot ]) -> None :
210202 state_sync .push_snapshots (snapshots )
211203 snapshot_ids = {snapshot .snapshot_id for snapshot in snapshots }
@@ -1555,9 +1547,21 @@ def test_snapshot_batching(state_sync, mocker, make_snapshot):
15551547 )
15561548 )
15571549 calls = mock .delete_from .call_args_list
1558- assert len (calls ) == 2
1559- assert calls [0 ][1 ] == {"where" : parse_one ("(name, identifier) in (('a', '1'), ('a', '2'))" )}
1560- assert calls [1 ][1 ] == {"where" : parse_one ("(name, identifier) in (('a', '3'))" )}
1550+ assert mock .delete_from .call_args_list == [
1551+ call (
1552+ exp .to_table ("sqlmesh._snapshots" ),
1553+ where = parse_one ("(name, identifier) in (('a', '1'), ('a', '2'))" ),
1554+ ),
1555+ call (
1556+ exp .to_table ("sqlmesh._seeds" ),
1557+ where = parse_one ("(name, identifier) in (('a', '1'), ('a', '2'))" ),
1558+ ),
1559+ call (
1560+ exp .to_table ("sqlmesh._snapshots" ),
1561+ where = parse_one ("(name, identifier) in (('a', '3'))" ),
1562+ ),
1563+ call (exp .to_table ("sqlmesh._seeds" ), where = parse_one ("(name, identifier) in (('a', '3'))" )),
1564+ ]
15611565
15621566 mock .fetchall .side_effect = [
15631567 [
0 commit comments