From d0e7b4db57b5fbeeab9b1cb3d106f00abeb2d1fd 2012-03-27 20:50:19 From: Tim Couper Date: 2012-03-27 20:50:19 Subject: [PATCH] added tests for limit_to__all__ for False and True cases --- diff --git a/IPython/core/tests/test_completer.py b/IPython/core/tests/test_completer.py index ab2c7b6..2198d89 100644 --- a/IPython/core/tests/test_completer.py +++ b/IPython/core/tests/test_completer.py @@ -230,6 +230,31 @@ def test_omit__names(): nt.assert_false('ip._hidden_attr' in matches) del ip._hidden_attr + +def test_limit_to__all__False_ok(): + ip = get_ipython() + c = ip.Completer + ip.ex('class D: x=24') + ip.ex('d=D()') + cfg = Config() + cfg.IPCompleter.limit_to__all__ = False + c.update_config(cfg) + s, matches = c.complete('d.') + nt.assert_true('d.x' in matches) + +def test_limit_to__all__True_ok(): + ip = get_ipython() + c = ip.Completer + ip.ex('class D: x=24') + ip.ex('d=D()') + ip.ex("d.__all__=['z']") + cfg = Config() + cfg.IPCompleter.limit_to__all__ = True + c.update_config(cfg) + s, matches = c.complete('d.') + nt.assert_true('d.z' in matches) + nt.assert_false('d.x' in matches) + def test_get__all__entries_ok(): class A(object): __all__ = ['x', 1]