Show More
@@ -230,6 +230,31 b' def test_omit__names():' | |||||
230 | nt.assert_false('ip._hidden_attr' in matches) |
|
230 | nt.assert_false('ip._hidden_attr' in matches) | |
231 | del ip._hidden_attr |
|
231 | del ip._hidden_attr | |
232 |
|
232 | |||
|
233 | ||||
|
234 | def test_limit_to__all__False_ok(): | |||
|
235 | ip = get_ipython() | |||
|
236 | c = ip.Completer | |||
|
237 | ip.ex('class D: x=24') | |||
|
238 | ip.ex('d=D()') | |||
|
239 | cfg = Config() | |||
|
240 | cfg.IPCompleter.limit_to__all__ = False | |||
|
241 | c.update_config(cfg) | |||
|
242 | s, matches = c.complete('d.') | |||
|
243 | nt.assert_true('d.x' in matches) | |||
|
244 | ||||
|
245 | def test_limit_to__all__True_ok(): | |||
|
246 | ip = get_ipython() | |||
|
247 | c = ip.Completer | |||
|
248 | ip.ex('class D: x=24') | |||
|
249 | ip.ex('d=D()') | |||
|
250 | ip.ex("d.__all__=['z']") | |||
|
251 | cfg = Config() | |||
|
252 | cfg.IPCompleter.limit_to__all__ = True | |||
|
253 | c.update_config(cfg) | |||
|
254 | s, matches = c.complete('d.') | |||
|
255 | nt.assert_true('d.z' in matches) | |||
|
256 | nt.assert_false('d.x' in matches) | |||
|
257 | ||||
233 | def test_get__all__entries_ok(): |
|
258 | def test_get__all__entries_ok(): | |
234 | class A(object): |
|
259 | class A(object): | |
235 | __all__ = ['x', 1] |
|
260 | __all__ = ['x', 1] |
General Comments 0
You need to be logged in to leave comments.
Login now