mirror of
https://github.com/davidhalter/jedi.git
synced 2025-12-22 13:21:26 +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
|
import readline
|
||||||
|
|
||||||
from jedi import utils
|
from jedi import utils
|
||||||
|
from .helpers import TestCase
|
||||||
|
|
||||||
|
|
||||||
class TestSetupReadline():
|
class TestSetupReadline(TestCase):
|
||||||
namespace = dict()
|
def __init__(self, *args, **kwargs):
|
||||||
utils.setup_readline(namespace)
|
super(type(self), self).__init__(*args, **kwargs)
|
||||||
|
self.namespace = dict()
|
||||||
|
utils.setup_readline(self.namespace)
|
||||||
|
|
||||||
def completions(self, text):
|
def completions(self, text):
|
||||||
completer = readline.get_completer()
|
completer = readline.get_completer()
|
||||||
@@ -37,12 +40,12 @@ class TestSetupReadline():
|
|||||||
self.namespace['sys'] = sys
|
self.namespace['sys'] = sys
|
||||||
self.namespace['os'] = os
|
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') == ['os.path.join']
|
||||||
assert self.completions('os.path.join().upper') == ['os.path.join().upper']
|
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['sys']
|
||||||
del self.namespace['os']
|
del self.namespace['os']
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user