From 056ad1b8a8d673c9e9aed25d7a18280048c32cad Mon Sep 17 00:00:00 2001 From: Dave Halter Date: Fri, 1 Jul 2016 08:42:05 +0200 Subject: [PATCH] Fix a few more tests that where not correctly written a while ago. --- test/test_api/test_interpreter.py | 2 +- test/test_utils.py | 5 +++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/test/test_api/test_interpreter.py b/test/test_api/test_interpreter.py index eb5b5865..1997b5ad 100644 --- a/test/test_api/test_interpreter.py +++ b/test/test_api/test_interpreter.py @@ -87,7 +87,7 @@ class TestInterpreterAPI(TestCase): def test_complete_raw_module(self): import os - self.check_interpreter_complete('os.path.join().up', + self.check_interpreter_complete('os.path.join("a").up', locals(), ['upper']) diff --git a/test/test_utils.py b/test/test_utils.py index 33353de1..2eb6e8ca 100644 --- a/test/test_utils.py +++ b/test/test_utils.py @@ -34,7 +34,7 @@ class TestSetupReadline(unittest.TestCase): def test_simple(self): assert self.completions('list') == ['list'] assert self.completions('importerror') == ['ImportError'] - s = "print BaseE" + s = "print(BaseE" assert self.completions(s) == [s + 'xception'] def test_nested(self): @@ -53,7 +53,8 @@ class TestSetupReadline(unittest.TestCase): try: assert self.completions('os.path.join') == ['os.path.join'] - assert self.completions('os.path.join().upper') == ['os.path.join().upper'] + string = 'os.path.join("a").upper' + assert self.completions(string) == [string] c = set(['os.' + d for d in dir(os) if d.startswith('ch')]) assert set(self.completions('os.ch')) == set(c)