def test_get_new_command_with_settings(mocker, monkeypatch, test, settings): mocker.patch("os.path.isfile", return_value=True) monkeypatch.setenv("EDITOR", "dummy_editor") cmd = Command(script=test[0], stdout=test[4], stderr=test[5]) settings.fixcolcmd = "{editor} {file} +{line}:{col}" if test[3]: assert get_new_command(cmd) == u"dummy_editor {} +{}:{} && {}".format(test[1], test[2], test[3], test[0]) else: assert get_new_command(cmd) == u"dummy_editor {} +{} && {}".format(test[1], test[2], test[0])
def test_get_new_command_with_settings(mocker, monkeypatch, test, settings): mocker.patch('os.path.isfile', return_value=True) monkeypatch.setenv('EDITOR', 'dummy_editor') cmd = Command(test.script, test.output) settings.fixcolcmd = '{editor} {file} +{line}:{col}' if test.col: assert (get_new_command(cmd) == u'dummy_editor {} +{}:{} && {}'.format( test.file, test.line, test.col, test.script)) else: assert (get_new_command(cmd) == u'dummy_editor {} +{} && {}'.format( test.file, test.line, test.script))
def test_get_new_command_with_settings(mocker, monkeypatch, test, settings): mocker.patch("os.path.isfile", return_value=True) monkeypatch.setenv("EDITOR", "dummy_editor") cmd = Command(test[0], test[4]) settings.fixcolcmd = "{editor} {file} +{line}:{col}" if test[3]: assert get_new_command(cmd) == u"dummy_editor {} +{}:{} && {}".format( test[1], test[2], test[3], test[0]) else: assert get_new_command(cmd) == u"dummy_editor {} +{} && {}".format( test[1], test[2], test[0])
def test_get_new_command_with_settings(mocker, monkeypatch, test, settings): mocker.patch('os.path.isfile', return_value=True) monkeypatch.setenv('EDITOR', 'dummy_editor') cmd = Command(script=test[0], stdout=test[4], stderr=test[5]) settings.fixcolcmd = '{editor} {file} +{line}:{col}' if test[3]: assert (get_new_command(cmd) == u'dummy_editor {} +{}:{} && {}'.format( test[1], test[2], test[3], test[0])) else: assert (get_new_command(cmd) == u'dummy_editor {} +{} && {}'.format( test[1], test[2], test[0]))
def test_get_new_command_with_settings(mocker, monkeypatch, test, settings): mocker.patch('os.path.isfile', return_value=True) monkeypatch.setenv('EDITOR', 'dummy_editor') cmd = Command(script=test[0], stdout=test[4], stderr=test[5]) settings.fixcolcmd = '{editor} {file} +{line}:{col}' if test[3]: assert (get_new_command(cmd) == 'dummy_editor {} +{}:{} && {}'.format(test[1], test[2], test[3], test[0])) else: assert (get_new_command(cmd) == 'dummy_editor {} +{} && {}'.format(test[1], test[2], test[0]))
def test_get_new_command(monkeypatch, test): monkeypatch.setenv('EDITOR', 'dummy_editor') assert (get_new_command(Command(script=test[0], stderr=test[4]), None) == 'dummy_editor {} +{} && {}'.format( test[1], test[2], test[0]))
def test_get_new_command(monkeypatch, test): monkeypatch.setenv('EDITOR', 'dummy_editor') assert (get_new_command(Command(script=test[0], stderr=test[4]), None) == 'dummy_editor {} +{} && {}'.format(test[1], test[2], test[0]))