@@ -4786,17 +4786,15 @@ def test_grants_create_model_kind(
47864786
47874787
47884788@pytest .mark .parametrize (
4789- "target_layer,apply_on_create,apply_on_promote " ,
4789+ "target_layer" ,
47904790 [
4791- ( GrantsTargetLayer .PHYSICAL , True , False ) ,
4792- ( GrantsTargetLayer .VIRTUAL , False , True ) ,
4793- ( GrantsTargetLayer .ALL , True , True ) ,
4791+ GrantsTargetLayer .PHYSICAL ,
4792+ GrantsTargetLayer .VIRTUAL ,
4793+ GrantsTargetLayer .ALL ,
47944794 ],
47954795)
47964796def test_grants_target_layer (
47974797 target_layer : GrantsTargetLayer ,
4798- apply_on_create : bool ,
4799- apply_on_promote : bool ,
48004798 adapter_mock : Mock ,
48014799 mocker : MockerFixture ,
48024800 make_snapshot : t .Callable [..., Snapshot ],
@@ -4818,19 +4816,17 @@ def test_grants_target_layer(
48184816 snapshot .categorize_as (SnapshotChangeCategory .BREAKING )
48194817
48204818 evaluator .create ([snapshot ], {})
4821- if apply_on_create :
4822- sync_grants_mock .assert_called_once ()
4823- assert sync_grants_mock .call_args [0 ][1 ] == grants
4819+ if target_layer == GrantsTargetLayer .VIRTUAL :
4820+ assert sync_grants_mock .call_count == 0
48244821 else :
4825- sync_grants_mock .assert_not_called ()
4826-
4822+ assert sync_grants_mock .call_count == 1
4823+ assert sync_grants_mock . call_args [ 0 ][ 1 ] == grants
48274824 sync_grants_mock .reset_mock ()
48284825 evaluator .promote ([snapshot ], EnvironmentNamingInfo (name = "prod" ))
4829- if apply_on_promote :
4830- sync_grants_mock .assert_called_once ()
4831- assert sync_grants_mock .call_args [0 ][1 ] == grants
4826+ if target_layer == GrantsTargetLayer .ALL :
4827+ assert sync_grants_mock .call_count == 2
48324828 else :
4833- sync_grants_mock .assert_not_called ()
4829+ assert sync_grants_mock .call_count == 1
48344830
48354831
48364832def test_grants_update (
0 commit comments