File tree Expand file tree Collapse file tree 1 file changed +29
-0
lines changed Expand file tree Collapse file tree 1 file changed +29
-0
lines changed Original file line number Diff line number Diff line change @@ -198,6 +198,35 @@ def test_a_second_entry_point_class_method(self):
198198 self .assertRegex (got , "from foo\.baz import Bar" )
199199 self .assertRegex (got , "sys\.exit\(Bar\.baz\(\)\)" )
200200
201+ def test_shebang_included (self ):
202+ with tempfile .TemporaryDirectory () as tmpdir :
203+ tmpdir = pathlib .Path (tmpdir )
204+ given_contents = (
205+ textwrap .dedent (
206+ """
207+ [console_scripts]
208+ foo = foo.bar:baz
209+ """
210+ ).strip ()
211+ + "\n "
212+ )
213+ entry_points = tmpdir / "entry_points.txt"
214+ entry_points .write_text (given_contents )
215+ out = tmpdir / "foo.py"
216+
217+ shebang = "#!/usr/bin/env python3"
218+ run (
219+ entry_points = entry_points ,
220+ out = out ,
221+ console_script = None ,
222+ console_script_guess = "foo" ,
223+ shebang = shebang ,
224+ )
225+
226+ got = out .read_text ()
227+
228+ self .assertTrue (got .startswith (shebang + "\n " ))
229+
201230
202231if __name__ == "__main__" :
203232 unittest .main ()
You can’t perform that action at this time.
0 commit comments