Show More
@@ -25,10 +25,11 b' import re' | |||||
25 | import sys |
|
25 | import sys | |
26 | from unittest import TestCase |
|
26 | from unittest import TestCase | |
27 |
|
27 | |||
|
28 | import nose.tools as nt | |||
28 | from nose import SkipTest |
|
29 | from nose import SkipTest | |
29 |
|
30 | |||
30 | from IPython.utils.traitlets import ( |
|
31 | from IPython.utils.traitlets import ( | |
31 | HasTraits, MetaHasTraits, TraitType, Any, CBytes, |
|
32 | HasTraits, MetaHasTraits, TraitType, Any, CBytes, Dict, | |
32 | Int, Long, Integer, Float, Complex, Bytes, Unicode, TraitError, |
|
33 | Int, Long, Integer, Float, Complex, Bytes, Unicode, TraitError, | |
33 | Undefined, Type, This, Instance, TCPAddress, List, Tuple, |
|
34 | Undefined, Type, This, Instance, TCPAddress, List, Tuple, | |
34 | ObjectName, DottedObjectName, CRegExp |
|
35 | ObjectName, DottedObjectName, CRegExp | |
@@ -906,3 +907,14 b' class TestCRegExp(TraitTestBase):' | |||||
906 | _default_value = re.compile(r'') |
|
907 | _default_value = re.compile(r'') | |
907 | _good_values = [r'\d+', re.compile(r'\d+')] |
|
908 | _good_values = [r'\d+', re.compile(r'\d+')] | |
908 | _bad_values = [r'(', None, ()] |
|
909 | _bad_values = [r'(', None, ()] | |
|
910 | ||||
|
911 | class DictTrait(HasTraits): | |||
|
912 | value = Dict() | |||
|
913 | ||||
|
914 | def test_dict_assignment(): | |||
|
915 | d = dict() | |||
|
916 | c = DictTrait() | |||
|
917 | c.value = d | |||
|
918 | d['a'] = 5 | |||
|
919 | nt.assert_equal(d, c.value) | |||
|
920 | nt.assert_true(c.value is d) |
General Comments 0
You need to be logged in to leave comments.
Login now