From 586738f0b3917903a09d29f55dc53a27edc68353 Mon Sep 17 00:00:00 2001 From: Dick Marinus Date: Tue, 28 Mar 2017 21:09:30 +0200 Subject: [PATCH] switch from nano to ex --- .travis.yml | 4 ---- tests/features/environment.py | 2 +- tests/features/steps/iocommands.py | 13 +++++++------ 3 files changed, 8 insertions(+), 11 deletions(-) diff --git a/.travis.yml b/.travis.yml index 643fd39f..d57f18a7 100644 --- a/.travis.yml +++ b/.travis.yml @@ -6,10 +6,6 @@ python: - "3.5" - "3.6" -before_install: - - sudo apt-get -qq update - - sudo apt-get install -y nano - install: - pip install . pytest mock codecov==1.5.1 behave pexpect==3.3 diff --git a/tests/features/environment.py b/tests/features/environment.py index 0febcfc6..51ae86b5 100644 --- a/tests/features/environment.py +++ b/tests/features/environment.py @@ -15,7 +15,7 @@ def before_all(context): os.environ['LINES'] = "100" os.environ['COLUMNS'] = "100" os.environ['PAGER'] = 'cat' - os.environ['EDITOR'] = 'nano' + os.environ['EDITOR'] = 'ex' os.environ["COVERAGE_PROCESS_START"] = os.getcwd() + "/../.coveragerc" context.exit_sent = False diff --git a/tests/features/steps/iocommands.py b/tests/features/steps/iocommands.py index ed277dae..69d9e1b9 100644 --- a/tests/features/steps/iocommands.py +++ b/tests/features/steps/iocommands.py @@ -16,21 +16,22 @@ def step_edit_file(context): if os.path.exists(context.editor_file_name): os.remove(context.editor_file_name) context.cli.sendline('\e {0}'.format(context.editor_file_name)) - wrappers.expect_exact(context, 'nano', timeout=2) + wrappers.expect_exact(context, 'Entering Ex mode. Type "visual" to go to Normal mode.', timeout=2) + wrappers.expect_exact(context, '\r\n:', timeout=2) @when('we type sql in the editor') def step_edit_type_sql(context): + context.cli.sendline('i') context.cli.sendline('select * from abc') - # Write the file. - context.cli.sendcontrol('o') - # Confirm file name sending "enter". - context.cli.sendcontrol('m') + context.cli.sendline('.') + wrappers.expect_exact(context, ':', timeout=2) @when('we exit the editor') def step_edit_quit(context): - context.cli.sendcontrol('x') + context.cli.sendline('x') + wrappers.expect_exact(context, "written", timeout=2) @then('we see the sql in prompt')