def test_should_invoke_command_without_title_when_no_previous_command_executed_windows(self): sys = mock_sys('win32') os = mock_os() view = mock_sublime_view() edit = mock_sublime_edit() command = commands.ReportIssueCommand(view, os, sys) command.run(edit) os.system.assert_called_once_with('cmd /c start %s' % create_issue_url('{command name}'))
def test_should_invoke_command_without_title_when_no_previous_command_executed_windows( self): sys = mock_sys('win32') os = mock_os() view = mock_sublime_view() edit = mock_sublime_edit() command = commands.ReportIssueCommand(view, os, sys) command.run(edit) os.system.assert_called_once_with('cmd /c start %s' % create_issue_url('{command name}'))
def test_should_invoke_command_with_title_when_last_command_exists(self): sys = mock_sys('darwin') os = mock_os() view = mock_sublime_view() edit = mock_sublime_edit() view.settings().set('indent_x_last_command', 'stuff') command = commands.ReportIssueCommand(view, os, sys) command.run(edit) os.system.assert_called_once_with('open "%s"' % create_issue_url('stuff'))
def test_should_invoke_command_with_title_when_last_command_exists(self): sys = mock_sys('darwin') os = mock_os() view = mock_sublime_view() edit = mock_sublime_edit() view.settings().set('indent_x_last_command', 'stuff') command = commands.ReportIssueCommand(view, os, sys) command.run(edit) os.system.assert_called_once_with('open "%s"' % create_issue_url('stuff'))
def test_should_invoke_command_with_title_after_command_executed(self): sys = mock_sys('darwin') region = mock_regions(['{ }'])[0] sublime = mock_sublime(region) view = mock_sublime_view([], lambda sel: sel()) os = mock_os() edit = mock_sublime_edit() command = commands.IndentCommand(view, sublime) command.run(edit) command = commands.ReportIssueCommand(view, os, sys) command.run(edit) os.system.assert_called_once_with('open "%s"' % create_issue_url('Indent'))
def test_should_invoke_command_with_title_after_command_executed(self): sys = mock_sys('darwin') region = mock_regions(['{ }'])[0] sublime = mock_sublime(region) view = mock_sublime_view([], lambda sel: sel()) os = mock_os() edit = mock_sublime_edit() command = commands.IndentCommand(view, sublime) command.run(edit) command = commands.ReportIssueCommand(view, os, sys) command.run(edit) os.system.assert_called_once_with('open "%s"' % create_issue_url('Indent'))