@@ -4968,17 +4968,15 @@ def test_grants_create_model_kind(
49684968
49694969
49704970@pytest .mark .parametrize (
4971- "target_layer,apply_on_create,apply_on_promote " ,
4971+ "target_layer" ,
49724972 [
4973- ( GrantsTargetLayer .PHYSICAL , True , False ) ,
4974- ( GrantsTargetLayer .VIRTUAL , False , True ) ,
4975- ( GrantsTargetLayer .ALL , True , True ) ,
4973+ GrantsTargetLayer .PHYSICAL ,
4974+ GrantsTargetLayer .VIRTUAL ,
4975+ GrantsTargetLayer .ALL ,
49764976 ],
49774977)
49784978def test_grants_target_layer (
49794979 target_layer : GrantsTargetLayer ,
4980- apply_on_create : bool ,
4981- apply_on_promote : bool ,
49824980 adapter_mock : Mock ,
49834981 mocker : MockerFixture ,
49844982 make_snapshot : t .Callable [..., Snapshot ],
@@ -5000,19 +4998,17 @@ def test_grants_target_layer(
50004998 snapshot .categorize_as (SnapshotChangeCategory .BREAKING )
50014999
50025000 evaluator .create ([snapshot ], {})
5003- if apply_on_create :
5004- sync_grants_mock .assert_called_once ()
5005- assert sync_grants_mock .call_args [0 ][1 ] == grants
5001+ if target_layer == GrantsTargetLayer .VIRTUAL :
5002+ assert sync_grants_mock .call_count == 0
50065003 else :
5007- sync_grants_mock .assert_not_called ()
5008-
5004+ assert sync_grants_mock .call_count == 1
5005+ assert sync_grants_mock . call_args [ 0 ][ 1 ] == grants
50095006 sync_grants_mock .reset_mock ()
50105007 evaluator .promote ([snapshot ], EnvironmentNamingInfo (name = "prod" ))
5011- if apply_on_promote :
5012- sync_grants_mock .assert_called_once ()
5013- assert sync_grants_mock .call_args [0 ][1 ] == grants
5008+ if target_layer == GrantsTargetLayer .ALL :
5009+ assert sync_grants_mock .call_count == 2
50145010 else :
5015- sync_grants_mock .assert_not_called ()
5011+ assert sync_grants_mock .call_count == 1
50165012
50175013
50185014def test_grants_update (
0 commit comments