mirror of
https://github.com/davidhalter/jedi.git
synced 2025-12-07 06:24:27 +08:00
fix a problem with testing setup_readline, when running all tests, this should also mean that #280 is now really finished
This commit is contained in:
@@ -1,11 +1,14 @@
|
||||
import readline
|
||||
|
||||
from jedi import utils
|
||||
from .helpers import TestCase
|
||||
|
||||
|
||||
class TestSetupReadline():
|
||||
namespace = dict()
|
||||
utils.setup_readline(namespace)
|
||||
class TestSetupReadline(TestCase):
|
||||
def __init__(self, *args, **kwargs):
|
||||
super(type(self), self).__init__(*args, **kwargs)
|
||||
self.namespace = dict()
|
||||
utils.setup_readline(self.namespace)
|
||||
|
||||
def completions(self, text):
|
||||
completer = readline.get_completer()
|
||||
@@ -37,12 +40,12 @@ class TestSetupReadline():
|
||||
self.namespace['sys'] = sys
|
||||
self.namespace['os'] = os
|
||||
|
||||
c = set(['os.' + d for d in dir(os) if d.startswith('ch')])
|
||||
assert set(self.completions('os.ch')) == set(c)
|
||||
assert self.completions('os.chdir') == ['os.chdir']
|
||||
assert self.completions('os.path.join') == ['os.path.join']
|
||||
assert self.completions('os.path.join().upper') == ['os.path.join().upper']
|
||||
|
||||
c = set(['os.' + d for d in dir(os) if d.startswith('ch')])
|
||||
assert set(self.completions('os.ch')) == set(c)
|
||||
|
||||
del self.namespace['sys']
|
||||
del self.namespace['os']
|
||||
|
||||
|
||||
Reference in New Issue
Block a user