@@ -950,7 +950,17 @@ def test_localhost_json_e2e(self):
950950 self .factory .block_until_ready (1 )
951951 client = self .factory .client ()
952952
953+ # Tests 2
954+ # self.factory._storages['splits'].remove('SPLIT_2')
955+ self .factory ._sync_manager ._synchronizer ._split_synchronizers ._split_sync ._split_storage .set_change_number (- 1 )
956+ self ._update_temp_file (splits_json ['splitChange2_1' ])
957+ self ._synchronize_now ()
958+
959+ assert self .factory .manager ().split_names () == ["SPLIT_1" ]
960+ assert client .get_treatment ("key" , "SPLIT_1" , None ) == 'off'
961+
953962 # Tests 1
963+ self .factory ._storages ['splits' ].remove ('SPLIT_1' )
954964 self .factory ._sync_manager ._synchronizer ._split_synchronizers ._split_sync ._split_storage .set_change_number (- 1 )
955965 self ._update_temp_file (splits_json ['splitChange1_1' ])
956966 self ._synchronize_now ()
@@ -1052,22 +1062,16 @@ def test_localhost_json_e2e(self):
10521062 assert client .get_treatment ("key" , "SPLIT_1" , None ) == 'control'
10531063 assert client .get_treatment ("key" , "SPLIT_2" , None ) == 'on'
10541064
1055- # Tests 2
1056- self .factory ._storages ['splits' ].remove ('SPLIT_2' )
1057- self .factory ._sync_manager ._synchronizer ._split_synchronizers ._split_sync ._split_storage .set_change_number (- 1 )
1058- self ._update_temp_file (splits_json ['splitChange2_1' ])
1059- self ._synchronize_now ()
1060-
1061- assert self .factory .manager ().split_names () == ["SPLIT_1" ]
1062- assert client .get_treatment ("key" , "SPLIT_1" , None ) == 'off'
1063-
10641065 def _update_temp_file (self , json_body ):
10651066 f = open (os .path .join (os .path .dirname (__file__ ), 'files' ,'split_changes_temp.json' ), 'w' )
10661067 f .write (json .dumps (json_body ))
1068+ print (os .path .join (os .path .dirname (__file__ ), 'files' ,'split_changes_temp.json' ))
1069+ print (json .dumps (json_body ))
10671070 f .close ()
10681071
10691072 def _synchronize_now (self ):
10701073 filename = os .path .join (os .path .dirname (__file__ ), 'files' , 'split_changes_temp.json' )
1074+ print (filename )
10711075 self .factory ._sync_manager ._synchronizer ._split_synchronizers ._split_sync ._filename = filename
10721076 self .factory ._sync_manager ._synchronizer ._split_synchronizers ._split_sync .synchronize_splits ()
10731077
0 commit comments