@@ -160,9 +160,12 @@ def test_Registry_before_spec_with_tags(self):
160160 registry .add_before_spec (info ['func' ], info ['tags' ])
161161
162162 self .assertEqual ([info1 ['func' ]], [i .impl for i in registry .before_spec ([])])
163- self .assertEqual ([x ['func' ] for x in infos ], [i .impl for i in registry .before_spec (['A' , 'b' ])])
164- self .assertEqual ([info1 ['func' ], info3 ['func' ]], [i .impl for i in registry .before_spec (['A' , 'b' , 'c' ])])
165- self .assertEqual ([info1 ['func' ], info3 ['func' ]], [i .impl for i in registry .before_spec (['A' ])])
163+ self .assertEqual ([x ['func' ] for x in infos ], [
164+ i .impl for i in registry .before_spec (['A' , 'b' ])])
165+ self .assertEqual ([info1 ['func' ], info3 ['func' ]], [
166+ i .impl for i in registry .before_spec (['A' , 'b' , 'c' ])])
167+ self .assertEqual ([info1 ['func' ], info3 ['func' ]], [
168+ i .impl for i in registry .before_spec (['A' ])])
166169 self .assertEqual ([info1 ['func' ]], [i .impl for i in registry .before_spec (['A' , 'c' ])])
167170
168171 def test_Registry_after_spec_with_tags (self ):
@@ -176,9 +179,12 @@ def test_Registry_after_spec_with_tags(self):
176179 registry .add_after_spec (info ['func' ], info ['tags' ])
177180
178181 self .assertEqual ([info1 ['func' ]], [i .impl for i in registry .after_spec ([])])
179- self .assertEqual ([x ['func' ] for x in infos ], [i .impl for i in registry .after_spec (['A' , 'b' ])])
180- self .assertEqual ([info1 ['func' ], info3 ['func' ]], [i .impl for i in registry .after_spec (['A' , 'b' , 'c' ])])
181- self .assertEqual ([info1 ['func' ], info3 ['func' ]], [i .impl for i in registry .after_spec (['A' ])])
182+ self .assertEqual ([x ['func' ] for x in infos ], [
183+ i .impl for i in registry .after_spec (['A' , 'b' ])])
184+ self .assertEqual ([info1 ['func' ], info3 ['func' ]], [
185+ i .impl for i in registry .after_spec (['A' , 'b' , 'c' ])])
186+ self .assertEqual ([info1 ['func' ], info3 ['func' ]], [
187+ i .impl for i in registry .after_spec (['A' ])])
182188 self .assertEqual ([info1 ['func' ]], [i .impl for i in registry .after_spec (['A' , 'c' ])])
183189
184190 def test_Registry_before_scenario (self ):
@@ -269,9 +275,12 @@ def test_Registry_before_step_with_tags(self):
269275 registry .add_before_step (info ['func' ], info ['tags' ])
270276
271277 self .assertEqual ([info1 ['func' ]], [i .impl for i in registry .before_step ([])])
272- self .assertEqual ([x ['func' ] for x in infos ], [i .impl for i in registry .before_step (['A' , 'b' ])])
273- self .assertEqual ([info1 ['func' ], info3 ['func' ]], [i .impl for i in registry .before_step (['A' , 'b' , 'c' ])])
274- self .assertEqual ([info1 ['func' ], info3 ['func' ]], [i .impl for i in registry .before_step (['A' ])])
278+ self .assertEqual ([x ['func' ] for x in infos ], [
279+ i .impl for i in registry .before_step (['A' , 'b' ])])
280+ self .assertEqual ([info1 ['func' ], info3 ['func' ]], [
281+ i .impl for i in registry .before_step (['A' , 'b' , 'c' ])])
282+ self .assertEqual ([info1 ['func' ], info3 ['func' ]], [
283+ i .impl for i in registry .before_step (['A' ])])
275284 self .assertEqual ([info1 ['func' ]], [i .impl for i in registry .before_step (['A' , 'c' ])])
276285
277286 def test_Registry_after_step_with_tags (self ):
@@ -286,9 +295,12 @@ def test_Registry_after_step_with_tags(self):
286295 registry .add_after_step (info ['func' ], info ['tags' ])
287296
288297 self .assertEqual ([info1 ['func' ]], [i .impl for i in registry .after_step ([])])
289- self .assertEqual ([x ['func' ] for x in infos ], [i .impl for i in registry .after_step (['A' , 'b' ])])
290- self .assertEqual ([info1 ['func' ], info3 ['func' ]], [i .impl for i in registry .after_step (['A' , 'b' , 'c' ])])
291- self .assertEqual ([info1 ['func' ], info3 ['func' ]], [i .impl for i in registry .after_step (['A' ])])
298+ self .assertEqual ([x ['func' ] for x in infos ], [
299+ i .impl for i in registry .after_step (['A' , 'b' ])])
300+ self .assertEqual ([info1 ['func' ], info3 ['func' ]], [
301+ i .impl for i in registry .after_step (['A' , 'b' , 'c' ])])
302+ self .assertEqual ([info1 ['func' ], info3 ['func' ]], [
303+ i .impl for i in registry .after_step (['A' ])])
292304 self .assertEqual ([info1 ['func' ]], [i .impl for i in registry .after_step (['A' , 'c' ])])
293305
294306 def test_Registry__step_positions_of_a_given_file (self ):
@@ -361,6 +373,21 @@ def test_Registry_get_all_methods_in_should_give_all_the_methods_define_in_that_
361373 self .assertEqual (3 , len (registry .get_all_methods_in ("foo.py" )))
362374 self .assertEqual (2 , len (registry .get_all_methods_in ("bar.py" )))
363375
376+ def test_Registry_get_all_methods_in_should_handle_paths_case_sensitive (self ):
377+ lower_c_drive = 'c:/random/path/foo.py'
378+ upper_c_drive = 'C:/random/path/foo.py'
379+
380+ step_infos = [
381+ {'text' : 'Foo' , 'func' : 'func1' , 'file_name' : lower_c_drive },
382+ {'text' : 'Foo <>' , 'func' : 'func2' , 'file_name' : upper_c_drive }
383+ ]
384+ for info in step_infos :
385+ registry .add_step (info ['text' ], info ['func' ], info ['file_name' ])
386+
387+ """ Note: we should find both steps regardless the different spelling as the path is in fact equal! """
388+ self .assertEqual (2 , len (registry .get_all_methods_in (lower_c_drive )))
389+ self .assertEqual (2 , len (registry .get_all_methods_in (upper_c_drive )))
390+
364391 def tearDown (self ):
365392 global registry
366393 registry = Registry ()
0 commit comments