@@ -279,7 +279,10 @@ def test_quote_args(args, expect):
279279
280280@pytest .mark .parametrize ("line, expect_id, expect_line" , [pytest .param (* a , id = a [0 ]) for a in [
281281 ("#!/usr/bin/python" , "Test1" , None ),
282- ("#!/usr/bin/python2" , "Test2" , None ),
282+ ("#! /usr/bin/python2" , "Test2" , None ),
283+ ("#! custom" , None , "#!CUSTOM" ),
284+ ("#! custom full line" , None , "#!CUSTOM2" ),
285+ ("#!custom full line with extra" , None , None ),
283286 # TODO: More test cases
284287]])
285288def test_shebang_templates (fake_config , line , expect_id , expect_line ):
@@ -290,6 +293,8 @@ def test_shebang_templates(fake_config, line, expect_id, expect_line):
290293 fake_config .shebang_templates = {
291294 "/usr/bin/python" : "py" ,
292295 "/usr/bin/python2" : "py -V:Test/2" ,
296+ "custom" : "CUSTOM" ,
297+ "custom full line" : "CUSTOM2" ,
293298 }
294299 actual , actual_line = _replace_templates (fake_config , line , False )
295300 if expect_id :
@@ -298,4 +303,5 @@ def test_shebang_templates(fake_config, line, expect_id, expect_line):
298303 elif expect_line :
299304 assert expect_line == actual_line
300305 else :
301- pytest .fail ("Invalid test" )
306+ assert not actual
307+ assert not actual_line
0 commit comments