summaryrefslogtreecommitdiff
path: root/tests/test_parsing.py
diff options
context:
space:
mode:
authoranselor <anselor@gmail.com>2018-05-02 15:29:45 -0400
committerGitHub <noreply@github.com>2018-05-02 15:29:45 -0400
commitd37004d05d0be67f48f35d6986ea899a35bcf89f (patch)
treeb4575eda772450b54620d16c09d4d29c52abdec7 /tests/test_parsing.py
parent01e4e0296adf57c920c1e12c3c92f45f615894b1 (diff)
parenta95c8a065abeac286c196783393ecc49e4356f54 (diff)
downloadcmd2-git-d37004d05d0be67f48f35d6986ea899a35bcf89f.tar.gz
Merge pull request #379 from python-cmd2/pyscript
This merges pyscript and bash_completion branches into master
Diffstat (limited to 'tests/test_parsing.py')
-rw-r--r--tests/test_parsing.py18
1 files changed, 8 insertions, 10 deletions
diff --git a/tests/test_parsing.py b/tests/test_parsing.py
index 2682ec68..b61e2d06 100644
--- a/tests/test_parsing.py
+++ b/tests/test_parsing.py
@@ -8,16 +8,14 @@ problematic because they worked properly for some versions of pyparsing but not
Copyright 2017 Todd Leonhardt <todd.leonhardt@gmail.com>
Released under MIT license, see LICENSE file
"""
-import sys
-
-import cmd2
+from cmd2 import cmd2
import pytest
@pytest.fixture
def hist():
from cmd2.cmd2 import HistoryItem
- h = cmd2.cmd2.History([HistoryItem('first'), HistoryItem('second'), HistoryItem('third'), HistoryItem('fourth')])
+ h = cmd2.History([HistoryItem('first'), HistoryItem('second'), HistoryItem('third'), HistoryItem('fourth')])
return h
# Case-sensitive parser
@@ -25,7 +23,7 @@ def hist():
def parser():
c = cmd2.Cmd()
c.multilineCommands = ['multiline']
- c.parser_manager = cmd2.cmd2.ParserManager(redirector=c.redirector, terminators=c.terminators,
+ c.parser_manager = cmd2.ParserManager(redirector=c.redirector, terminators=c.terminators,
multilineCommands=c.multilineCommands, legalChars=c.legalChars,
commentGrammars=c.commentGrammars, commentInProgress=c.commentInProgress,
blankLinesAllowed=c.blankLinesAllowed, prefixParser=c.prefixParser,
@@ -38,7 +36,7 @@ def parser():
def cs_pm():
c = cmd2.Cmd()
c.multilineCommands = ['multiline']
- c.parser_manager = cmd2.cmd2.ParserManager(redirector=c.redirector, terminators=c.terminators,
+ c.parser_manager = cmd2.ParserManager(redirector=c.redirector, terminators=c.terminators,
multilineCommands=c.multilineCommands, legalChars=c.legalChars,
commentGrammars=c.commentGrammars, commentInProgress=c.commentInProgress,
blankLinesAllowed=c.blankLinesAllowed, prefixParser=c.prefixParser,
@@ -77,7 +75,7 @@ def test_history_get(hist):
def test_cast():
- cast = cmd2.cmd2.cast
+ cast = cmd2.cast
# Boolean
assert cast(True, True) == True
@@ -101,7 +99,7 @@ def test_cast():
def test_cast_problems(capsys):
- cast = cmd2.cmd2.cast
+ cast = cmd2.cast
expected = 'Problem setting parameter (now {}) to {}; incorrect type?\n'
@@ -327,8 +325,8 @@ def test_parse_input_redirect_from_unicode_filename(input_parser):
def test_empty_statement_raises_exception():
app = cmd2.Cmd()
- with pytest.raises(cmd2.cmd2.EmptyStatement):
+ with pytest.raises(cmd2.EmptyStatement):
app._complete_statement('')
- with pytest.raises(cmd2.cmd2.EmptyStatement):
+ with pytest.raises(cmd2.EmptyStatement):
app._complete_statement(' ')