From 560e44c637e4f1fcbeba1305fc1eb39e3d796013 Mon Sep 17 00:00:00 2001 From: Aldo Cortesi Date: Fri, 20 Mar 2015 10:54:57 +1300 Subject: Pull PathEdit out into its own file. --- test/test_console.py | 43 ------------------------------------------- 1 file changed, 43 deletions(-) (limited to 'test/test_console.py') diff --git a/test/test_console.py b/test/test_console.py index d66bd8b0..419b94a7 100644 --- a/test/test_console.py +++ b/test/test_console.py @@ -104,48 +104,5 @@ def test_format_keyvals(): ) -class TestPathCompleter: - def test_lookup_construction(self): - c = console._PathCompleter() - - cd = tutils.test_data.path("completion") - ca = os.path.join(cd, "a") - assert c.complete(ca).endswith(normpath("/completion/aaa")) - assert c.complete(ca).endswith(normpath("/completion/aab")) - c.reset() - ca = os.path.join(cd, "aaa") - assert c.complete(ca).endswith(normpath("/completion/aaa")) - assert c.complete(ca).endswith(normpath("/completion/aaa")) - c.reset() - assert c.complete(cd).endswith(normpath("/completion/aaa")) - - def test_completion(self): - c = console._PathCompleter(True) - c.reset() - c.lookup = [ - ("a", "x/a"), - ("aa", "x/aa"), - ] - assert c.complete("a") == "a" - assert c.final == "x/a" - assert c.complete("a") == "aa" - assert c.complete("a") == "a" - - c = console._PathCompleter(True) - r = c.complete("l") - assert c.final.endswith(r) - - c.reset() - assert c.complete("/nonexistent") == "/nonexistent" - assert c.final == "/nonexistent" - c.reset() - assert c.complete("~") != "~" - - c.reset() - s = "thisisatotallynonexistantpathforsure" - assert c.complete(s) == s - assert c.final == s - - def test_options(): assert console.Options(kill=True) -- cgit v1.2.3 From a05a70d8168a07c92b2a3ecbbb1958d85532efe3 Mon Sep 17 00:00:00 2001 From: Aldo Cortesi Date: Sat, 30 May 2015 12:03:28 +1200 Subject: Add coding style check, reformat. --- test/test_console.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'test/test_console.py') diff --git a/test/test_console.py b/test/test_console.py index 419b94a7..ed8408a5 100644 --- a/test/test_console.py +++ b/test/test_console.py @@ -1,4 +1,7 @@ -import os, sys, mock, gc +import os +import sys +import mock +import gc from os.path import normpath import mock_urwid from libmproxy import console @@ -6,6 +9,7 @@ from libmproxy.console import common import tutils + class TestConsoleState: def test_flow(self): """ -- cgit v1.2.3