@@ -2978,13 +2978,17 @@ def test_model_sync_multi_link_01(self):
29782978 def _testcase (
29792979 model_type : typing .Type [GelModel ],
29802980 initial_targets : typing .Collection [typing .Any ],
2981+ expected_targets : typing .Collection [typing .Any ] | None = None ,
29812982 ) -> None :
2983+ if expected_targets is None :
2984+ expected_targets = initial_targets
2985+
29822986 with_targets = model_type (targets = initial_targets )
29832987 without_targets = model_type ()
29842988
29852989 self .client .sync (with_targets , without_targets )
29862990
2987- self ._check_multilinks_equal (with_targets .targets , initial_targets )
2991+ self ._check_multilinks_equal (with_targets .targets , expected_targets )
29882992 self ._check_multilinks_equal (without_targets .targets , [])
29892993
29902994 # cleanup
@@ -2996,6 +3000,15 @@ def _testcase(
29963000
29973001 # With linkprops
29983002 _testcase (default .SourceWithProp , [])
3003+ _testcase (
3004+ default .SourceWithProp ,
3005+ [target_a , target_b , target_c ],
3006+ [
3007+ default .SourceWithProp .targets .link (target_a ),
3008+ default .SourceWithProp .targets .link (target_b ),
3009+ default .SourceWithProp .targets .link (target_c ),
3010+ ],
3011+ )
29993012 _testcase (
30003013 default .SourceWithProp ,
30013014 [
@@ -3026,12 +3039,16 @@ def _testcase_assign(
30263039 model_type : typing .Type [GelModel ],
30273040 initial_targets : typing .Collection [typing .Any ],
30283041 changed_targets : typing .Collection [typing .Any ],
3042+ expected_targets : typing .Collection [typing .Any ] | None = None ,
30293043 ) -> None :
3044+ if expected_targets is None :
3045+ expected_targets = changed_targets
3046+
30303047 self ._base_testcase (
30313048 model_type ,
30323049 initial_targets ,
30333050 self ._get_assign_targets_func (changed_targets ),
3034- changed_targets ,
3051+ expected_targets ,
30353052 )
30363053
30373054 def test_model_sync_multi_link_02 (self ):
@@ -3089,6 +3106,16 @@ def test_model_sync_multi_link_02(self):
30893106
30903107 # With linkprops
30913108 self ._testcase_assign (default .SourceWithProp , [], [])
3109+ self ._testcase_assign (
3110+ default .SourceWithProp ,
3111+ [],
3112+ [target_a , target_b , target_c ],
3113+ [
3114+ default .SourceWithProp .targets .link (target_a ),
3115+ default .SourceWithProp .targets .link (target_b ),
3116+ default .SourceWithProp .targets .link (target_c ),
3117+ ],
3118+ )
30923119 self ._testcase_assign (
30933120 default .SourceWithProp ,
30943121 [],
@@ -3117,6 +3144,20 @@ def test_model_sync_multi_link_02(self):
31173144 ],
31183145 [],
31193146 )
3147+ self ._testcase_assign (
3148+ default .SourceWithProp ,
3149+ [
3150+ default .SourceWithProp .targets .link (target_a ),
3151+ default .SourceWithProp .targets .link (target_b ),
3152+ default .SourceWithProp .targets .link (target_c ),
3153+ ],
3154+ [target_a , target_b , target_c ],
3155+ [
3156+ default .SourceWithProp .targets .link (target_a ),
3157+ default .SourceWithProp .targets .link (target_b ),
3158+ default .SourceWithProp .targets .link (target_c ),
3159+ ],
3160+ )
31203161 self ._testcase_assign (
31213162 default .SourceWithProp ,
31223163 [
@@ -3194,6 +3235,18 @@ def test_model_sync_multi_link_02(self):
31943235 ],
31953236 )
31963237
3238+ self ._testcase_assign (
3239+ default .SourceWithProp ,
3240+ [
3241+ default .SourceWithProp .targets .link (target_a ),
3242+ default .SourceWithProp .targets .link (target_b ),
3243+ ],
3244+ [target_c , target_d ],
3245+ [
3246+ default .SourceWithProp .targets .link (target_c ),
3247+ default .SourceWithProp .targets .link (target_d ),
3248+ ],
3249+ )
31973250 self ._testcase_assign (
31983251 default .SourceWithProp ,
31993252 [
0 commit comments