1
1
mirror of https://github.com/dbcli/pgcli.git synced 2024-10-06 10:17:15 +03:00

switch from nano to ex

This commit is contained in:
Dick Marinus 2017-03-28 21:09:30 +02:00 committed by Irina Truong
parent aaf31e87be
commit 586738f0b3
3 changed files with 8 additions and 11 deletions

View File

@ -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

View File

@ -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

View File

@ -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')