@@ -4788,17 +4788,15 @@ def test_grants_create_model_kind(
47884788
47894789
47904790@pytest .mark .parametrize (
4791- "target_layer,apply_on_create,apply_on_promote " ,
4791+ "target_layer" ,
47924792 [
4793- ( GrantsTargetLayer .PHYSICAL , True , False ) ,
4794- ( GrantsTargetLayer .VIRTUAL , False , True ) ,
4795- ( GrantsTargetLayer .ALL , True , True ) ,
4793+ GrantsTargetLayer .PHYSICAL ,
4794+ GrantsTargetLayer .VIRTUAL ,
4795+ GrantsTargetLayer .ALL ,
47964796 ],
47974797)
47984798def test_grants_target_layer (
47994799 target_layer : GrantsTargetLayer ,
4800- apply_on_create : bool ,
4801- apply_on_promote : bool ,
48024800 adapter_mock : Mock ,
48034801 mocker : MockerFixture ,
48044802 make_snapshot : t .Callable [..., Snapshot ],
@@ -4820,19 +4818,17 @@ def test_grants_target_layer(
48204818 snapshot .categorize_as (SnapshotChangeCategory .BREAKING )
48214819
48224820 evaluator .create ([snapshot ], {})
4823- if apply_on_create :
4824- sync_grants_mock .assert_called_once ()
4825- assert sync_grants_mock .call_args [0 ][1 ] == grants
4821+ if target_layer == GrantsTargetLayer .VIRTUAL :
4822+ assert sync_grants_mock .call_count == 0
48264823 else :
4827- sync_grants_mock .assert_not_called ()
4828-
4824+ assert sync_grants_mock .call_count == 1
4825+ assert sync_grants_mock . call_args [ 0 ][ 1 ] == grants
48294826 sync_grants_mock .reset_mock ()
48304827 evaluator .promote ([snapshot ], EnvironmentNamingInfo (name = "prod" ))
4831- if apply_on_promote :
4832- sync_grants_mock .assert_called_once ()
4833- assert sync_grants_mock .call_args [0 ][1 ] == grants
4828+ if target_layer == GrantsTargetLayer .ALL :
4829+ assert sync_grants_mock .call_count == 2
48344830 else :
4835- sync_grants_mock .assert_not_called ()
4831+ assert sync_grants_mock .call_count == 1
48364832
48374833
48384834def test_grants_update (
0 commit comments