From b4e3d1d65dfdd63bfb28d615001a1fc32efc7dc3 Mon Sep 17 00:00:00 2001 From: Takafumi Arakaki Date: Sun, 3 Mar 2013 12:08:59 +0100 Subject: [PATCH] Fix test_complete_raw_instance example 'dt.strftime("%Y").up' does not work even if with `api.Script`. Change it to the one that can be handled by Jedi. --- test/test_regression.py | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/test/test_regression.py b/test/test_regression.py index 41061676..acbfc60e 100755 --- a/test/test_regression.py +++ b/test/test_regression.py @@ -543,9 +543,10 @@ class TestInterpreterAPI(unittest.TestCase): def check_interpreter_complete(self, source, namespace, completions, **kwds): - cs = api.Interpreter(source, [namespace], **kwds).complete() + script = api.Interpreter(source, [namespace], **kwds) + cs = script.complete() actual = [c.word for c in cs] - self.assertEqual(actual, completions) + self.assertEqual(sorted(actual), sorted(completions)) def test_complete_raw_function(self): self.check_interpreter_complete('join().up', @@ -560,9 +561,9 @@ class TestInterpreterAPI(unittest.TestCase): def test_complete_raw_instance(self): import datetime dt = datetime.datetime(2013, 1, 1) - self.check_interpreter_complete('dt.strftime("%Y").up', + self.check_interpreter_complete('(dt - dt).ti', {'dt': dt}, - ['upper']) + ['time', 'timetz', 'timetuple']) def test_settings_module():