@@ -429,31 +429,30 @@ def test_relative_run_script(base_app, request):
429
429
430
430
def test_relative_run_script_with_odd_file_names (base_app , monkeypatch ):
431
431
"""Test file names with various patterns"""
432
- # Mock out the do_run_script call to see what args are passed
432
+ # Mock out the do_run_script call to see what args are passed to it
433
433
run_script_mock = mock .MagicMock (name = 'do_run_script' )
434
434
monkeypatch .setattr ("cmd2.Cmd.do_run_script" , run_script_mock )
435
435
436
436
file_name = utils .quote_string ('nothingweird.txt' )
437
- out , err = run_cmd (base_app , "run_script {}" .format (file_name ))
437
+ out , err = run_cmd (base_app , "_relative_run_script {}" .format (file_name ))
438
438
run_script_mock .assert_called_once_with ('"nothingweird.txt"' )
439
439
run_script_mock .reset_mock ()
440
440
441
441
file_name = utils .quote_string ('has spaces.txt' )
442
- out , err = run_cmd (base_app , "run_script {}" .format (file_name ))
442
+ out , err = run_cmd (base_app , "_relative_run_script {}" .format (file_name ))
443
443
run_script_mock .assert_called_once_with ('"has spaces.txt"' )
444
444
run_script_mock .reset_mock ()
445
445
446
446
file_name = utils .quote_string ('"is_double_quoted.txt"' )
447
- out , err = run_cmd (base_app , "run_script {}" .format (file_name ))
447
+ out , err = run_cmd (base_app , "_relative_run_script {}" .format (file_name ))
448
448
run_script_mock .assert_called_once_with ('\' "is_double_quoted.txt"\' ' )
449
449
run_script_mock .reset_mock ()
450
450
451
451
file_name = utils .quote_string ("'is_single_quoted.txt'" )
452
- out , err = run_cmd (base_app , "run_script {}" .format (file_name ))
452
+ out , err = run_cmd (base_app , "_relative_run_script {}" .format (file_name ))
453
453
run_script_mock .assert_called_once_with ('"\' is_single_quoted.txt\' "' )
454
454
run_script_mock .reset_mock ()
455
455
456
-
457
456
def test_relative_run_script_requires_an_argument (base_app ):
458
457
out , err = run_cmd (base_app , '_relative_run_script' )
459
458
assert 'Error: the following arguments' in err [1 ]
@@ -685,7 +684,7 @@ def test_edit_file(base_app, request, monkeypatch):
685
684
686
685
def test_edit_file_with_odd_file_names (base_app , monkeypatch ):
687
686
"""Test editor and file names with various patterns"""
688
- # Mock out the do_shell call to see what args are passed
687
+ # Mock out the do_shell call to see what args are passed to it
689
688
shell_mock = mock .MagicMock (name = 'do_shell' )
690
689
monkeypatch .setattr ("cmd2.Cmd.do_shell" , shell_mock )
691
690
0 commit comments