1
0
forked from VimPlug/jedi

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.
This commit is contained in:
Takafumi Arakaki
2013-03-03 12:08:59 +01:00
parent 45cad4c83b
commit b4e3d1d65d

View File

@@ -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():