def test_clear(self):
     with raises(TypeError):
         d = ImmutableDict({'test': 'blah', 'something': '2'})
         d.clear()
 def test_deep_copy(self):
     d = ImmutableDict({'test': 'blah', 'something': '2'})
     d2 = deepcopy(d)
     d3 = d.copy()
     assert d == d2
     assert d == d3
 def test_delete(self):
     with raises(TypeError):
         d = ImmutableDict({'test': 'blah', 'something': '2'})
         del d['test']
 def test_copy(self):
     d = ImmutableDict({'test': 'blah', 'something': '2'})
     c = copy(d)
     c['blah'] = 'blah'
     assert d != c
 def test_set_value(self):
     with raises(TypeError):
         d = ImmutableDict()
         d['something'] = 'test'
Exemplo n.º 6
0
 def test_create(self):
     d = ImmutableDict({'test': 'blah', 'something': '2'})
     assert d.__len__() == 2
 def test_create(self):
     d = ImmutableDict({'test': 'blah', 'something': '2'})
     assert len(d) == 2
Exemplo n.º 8
0
 def test_clear(self):
     d = ImmutableDict({'test': 'blah', 'something': '2'})
     d.clear()
Exemplo n.º 9
0
 def test_delete(self):
     d = ImmutableDict({'test': 'blah', 'something': '2'})
     del d['test']
Exemplo n.º 10
0
 def test_deep_copy(self):
     d = ImmutableDict({'test': 'blah', 'something': '2'})
     d2 = deepcopy(d)
     d3 = d.copy()
     assert d == d2
     assert d == d3
Exemplo n.º 11
0
 def test_set_value(self):
     d = ImmutableDict()
     d['something'] = 'test'
 def test_clear(self):
     with raises(TypeError):
         d = ImmutableDict({'test': 'blah', 'something': '2'})
         d.clear()