File: test_internal.py

package info (click to toggle)
python-pgspecial 1.11.10%2Bdfsg1-1
  • links: PTS, VCS
  • area: main
  • in suites: bullseye
  • size: 352 kB
  • sloc: python: 3,143; makefile: 3
file content (23 lines) | stat: -rw-r--r-- 717 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
"""
Tests for specific internal functions, not overall integration tests.
"""
import pytest 

from pgspecial import iocommands

def test_plain_editor_commands_detected():
    assert not iocommands.editor_command('select * from foo')
    assert not iocommands.editor_command(r'\easy does it')

    assert iocommands.editor_command(r'\e') == r'\e'
    assert iocommands.editor_command(r'\e myfile.txt') == r'\e'
    assert iocommands.editor_command(r'select * from foo \e') == r'\e'

    assert iocommands.editor_command(r'  \e  ') == r'\e'
    assert iocommands.editor_command(r'select * from foo \e  ') == r'\e'


def test_edit_view_command_detected():
    assert iocommands.editor_command(r'\ev myview') == r'\ev'