File tree Expand file tree Collapse file tree 2 files changed +5
-1
lines changed
Expand file tree Collapse file tree 2 files changed +5
-1
lines changed Original file line number Diff line number Diff line change @@ -95,7 +95,7 @@ def get_commands_from_file(fileobj):
9595 commands : list of str
9696 commands read from the file
9797 '''
98- return fileobj .read ().split ('\n ' )
98+ return fileobj .read ().strip (). split ('\n ' )
9999
100100
101101def get_commands_from_arguments (arguments ):
Original file line number Diff line number Diff line change @@ -72,6 +72,10 @@ def test_get_commands_from_file():
7272 fileobj = StringIO ("\n " .join (commands ))
7373 assert_array_equal (smartdispatch .get_commands_from_file (fileobj ), commands )
7474
75+ # Test stripping last line if empty
76+ fileobj = StringIO ("\n " .join (commands ) + "\n " )
77+ assert_array_equal (smartdispatch .get_commands_from_file (fileobj ), commands )
78+
7579
7680def test_get_commands_from_arguments ():
7781 # Test single unfolded arguments
You can’t perform that action at this time.
0 commit comments