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:
David Halter
2013-08-15 15:14:31 +04:30
parent 68d595fe70
commit 19f904f999

View File

@@ -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']