From c5b12fac66f7a60fa3028b2eec79196d2e512243 2015-03-20 14:49:16 From: Sylvain Corlay Date: 2015-03-20 14:49:16 Subject: [PATCH] adding a test --- diff --git a/IPython/utils/tests/test_traitlets.py b/IPython/utils/tests/test_traitlets.py index 8344a3d..4bb70cb 100644 --- a/IPython/utils/tests/test_traitlets.py +++ b/IPython/utils/tests/test_traitlets.py @@ -1079,6 +1079,19 @@ def test_dict_assignment(): nt.assert_equal(d, c.value) nt.assert_true(c.value is d) +class ValidatedDictTrait(HasTraits): + + value = Dict(Unicode()) + +class TestInstanceDict(TraitTestBase): + + obj = ValidatedDictTrait() + + _default_value = {} + _good_values = [{'0': 'foo'}, {'1': 'bar'}] + _bad_values = [{'0': 0}, {'1': 1}] + + def test_dict_default_value(): """Check that the `{}` default value of the Dict traitlet constructor is actually copied."""