mirror of
https://github.com/davidhalter/jedi.git
synced 2025-12-08 14:54:47 +08:00
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:
@@ -543,9 +543,10 @@ class TestInterpreterAPI(unittest.TestCase):
|
|||||||
|
|
||||||
def check_interpreter_complete(self, source, namespace, completions,
|
def check_interpreter_complete(self, source, namespace, completions,
|
||||||
**kwds):
|
**kwds):
|
||||||
cs = api.Interpreter(source, [namespace], **kwds).complete()
|
script = api.Interpreter(source, [namespace], **kwds)
|
||||||
|
cs = script.complete()
|
||||||
actual = [c.word for c in cs]
|
actual = [c.word for c in cs]
|
||||||
self.assertEqual(actual, completions)
|
self.assertEqual(sorted(actual), sorted(completions))
|
||||||
|
|
||||||
def test_complete_raw_function(self):
|
def test_complete_raw_function(self):
|
||||||
self.check_interpreter_complete('join().up',
|
self.check_interpreter_complete('join().up',
|
||||||
@@ -560,9 +561,9 @@ class TestInterpreterAPI(unittest.TestCase):
|
|||||||
def test_complete_raw_instance(self):
|
def test_complete_raw_instance(self):
|
||||||
import datetime
|
import datetime
|
||||||
dt = datetime.datetime(2013, 1, 1)
|
dt = datetime.datetime(2013, 1, 1)
|
||||||
self.check_interpreter_complete('dt.strftime("%Y").up',
|
self.check_interpreter_complete('(dt - dt).ti',
|
||||||
{'dt': dt},
|
{'dt': dt},
|
||||||
['upper'])
|
['time', 'timetz', 'timetuple'])
|
||||||
|
|
||||||
|
|
||||||
def test_settings_module():
|
def test_settings_module():
|
||||||
|
|||||||
Reference in New Issue
Block a user