@@ -172,14 +172,14 @@ def post_check(output):
172172 )
173173
174174 def test_call_pre_config_none (self ):
175- self .assertEqual (self ._call_pre_config (None , "output_path" , "simulator_output_path" ), True )
175+ self .assertEqual (self ._call_pre_config (None , "output_path" , "simulator_output_path" , "seed" ), True )
176176
177177 def test_call_pre_config_false (self ):
178178 def pre_config ():
179179 return False
180180
181181 self .assertEqual (
182- self ._call_pre_config (pre_config , "output_path" , "simulator_output_path" ),
182+ self ._call_pre_config (pre_config , "output_path" , "simulator_output_path" , "seed" ),
183183 False ,
184184 )
185185
@@ -188,7 +188,7 @@ def pre_config():
188188 return True
189189
190190 self .assertEqual (
191- self ._call_pre_config (pre_config , "output_path" , "simulator_output_path" ),
191+ self ._call_pre_config (pre_config , "output_path" , "simulator_output_path" , "seed" ),
192192 True ,
193193 )
194194
@@ -197,7 +197,7 @@ def pre_config():
197197 pass
198198
199199 self .assertEqual (
200- self ._call_pre_config (pre_config , "output_path" , "simulator_output_path" ),
200+ self ._call_pre_config (pre_config , "output_path" , "simulator_output_path" , "seed" ),
201201 False ,
202202 )
203203
@@ -209,13 +209,7 @@ def pre_config(output_path):
209209 self .assertEqual (output_path , "output_path" )
210210 raise WasHere
211211
212- self .assertRaises (
213- WasHere ,
214- self ._call_pre_config ,
215- pre_config ,
216- "output_path" ,
217- "simulator_output_path" ,
218- )
212+ self .assertRaises (WasHere , self ._call_pre_config , pre_config , "output_path" , "simulator_output_path" , "seed" )
219213
220214 def test_call_pre_config_with_simulator_output_path (self ):
221215 def pre_config (output_path , simulator_output_path ):
@@ -226,13 +220,19 @@ def pre_config(output_path, simulator_output_path):
226220 self .assertEqual (simulator_output_path , "simulator_output_path" )
227221 raise WasHere
228222
229- self .assertRaises (
230- WasHere ,
231- self ._call_pre_config ,
232- pre_config ,
233- "output_path" ,
234- "simulator_output_path" ,
235- )
223+ self .assertRaises (WasHere , self ._call_pre_config , pre_config , "output_path" , "simulator_output_path" , "seed" )
224+
225+ def test_call_pre_config_with_seed (self ):
226+ def pre_config (output_path , simulator_output_path , seed ):
227+ """
228+ Pre config with output path
229+ """
230+ self .assertEqual (output_path , "output_path" )
231+ self .assertEqual (simulator_output_path , "simulator_output_path" )
232+ self .assertEqual (seed , "seed" )
233+ raise WasHere
234+
235+ self .assertRaises (WasHere , self ._call_pre_config , pre_config , "output_path" , "simulator_output_path" , "seed" )
236236
237237 def test_call_pre_config_class_method (self ):
238238 class MyClass (object ):
@@ -243,30 +243,27 @@ class MyClass(object):
243243 def __init__ (self , value ):
244244 self .value = value
245245
246- def pre_config (self , output_path , simulator_output_path ):
246+ def pre_config (self , output_path , simulator_output_path , seed ):
247247 """
248248 Pre config with output path
249249 """
250250 assert self .value == 2
251251 assert output_path == "output_path"
252252 assert simulator_output_path == "simulator_output_path"
253+ assert seed == "seed"
253254 raise WasHere
254255
255256 self .assertRaises (
256- WasHere ,
257- self ._call_pre_config ,
258- MyClass (value = 2 ).pre_config ,
259- "output_path" ,
260- "simulator_output_path" ,
257+ WasHere , self ._call_pre_config , MyClass (value = 2 ).pre_config , "output_path" , "simulator_output_path" , "seed"
261258 )
262259
263260 @staticmethod
264- def _call_pre_config (pre_config , output_path , simulator_output_path ):
261+ def _call_pre_config (pre_config , output_path , simulator_output_path , seed ):
265262 """
266263 Helper method to test call_pre_config method
267264 """
268265 with _create_config (pre_config = pre_config ) as config :
269- return config .call_pre_config (output_path , simulator_output_path )
266+ return config .call_pre_config (output_path , simulator_output_path , seed )
270267
271268 @staticmethod
272269 def _call_post_check (post_check , ** kwargs ):
0 commit comments