@@ -4782,17 +4782,15 @@ def test_grants_create_model_kind(
47824782
47834783
47844784@pytest .mark .parametrize (
4785- "target_layer,apply_on_create,apply_on_promote " ,
4785+ "target_layer" ,
47864786 [
4787- ( GrantsTargetLayer .PHYSICAL , True , False ) ,
4788- ( GrantsTargetLayer .VIRTUAL , False , True ) ,
4789- ( GrantsTargetLayer .ALL , True , True ) ,
4787+ GrantsTargetLayer .PHYSICAL ,
4788+ GrantsTargetLayer .VIRTUAL ,
4789+ GrantsTargetLayer .ALL ,
47904790 ],
47914791)
47924792def test_grants_target_layer (
47934793 target_layer : GrantsTargetLayer ,
4794- apply_on_create : bool ,
4795- apply_on_promote : bool ,
47964794 adapter_mock : Mock ,
47974795 mocker : MockerFixture ,
47984796 make_snapshot : t .Callable [..., Snapshot ],
@@ -4814,19 +4812,17 @@ def test_grants_target_layer(
48144812 snapshot .categorize_as (SnapshotChangeCategory .BREAKING )
48154813
48164814 evaluator .create ([snapshot ], {})
4817- if apply_on_create :
4818- sync_grants_mock .assert_called_once ()
4819- assert sync_grants_mock .call_args [0 ][1 ] == grants
4815+ if target_layer == GrantsTargetLayer .VIRTUAL :
4816+ assert sync_grants_mock .call_count == 0
48204817 else :
4821- sync_grants_mock .assert_not_called ()
4822-
4818+ assert sync_grants_mock .call_count == 1
4819+ assert sync_grants_mock . call_args [ 0 ][ 1 ] == grants
48234820 sync_grants_mock .reset_mock ()
48244821 evaluator .promote ([snapshot ], EnvironmentNamingInfo (name = "prod" ))
4825- if apply_on_promote :
4826- sync_grants_mock .assert_called_once ()
4827- assert sync_grants_mock .call_args [0 ][1 ] == grants
4822+ if target_layer == GrantsTargetLayer .ALL :
4823+ assert sync_grants_mock .call_count == 2
48284824 else :
4829- sync_grants_mock .assert_not_called ()
4825+ assert sync_grants_mock .call_count == 1
48304826
48314827
48324828def test_grants_update (
0 commit comments