コード例 #1
0
 def test_clear(self):
     with raises(TypeError):
         d = ImmutableDict({'test': 'blah', 'something': '2'})
         d.clear()
コード例 #2
0
 def test_deep_copy(self):
     d = ImmutableDict({'test': 'blah', 'something': '2'})
     d2 = deepcopy(d)
     d3 = d.copy()
     assert d == d2
     assert d == d3
コード例 #3
0
 def test_delete(self):
     with raises(TypeError):
         d = ImmutableDict({'test': 'blah', 'something': '2'})
         del d['test']
コード例 #4
0
 def test_copy(self):
     d = ImmutableDict({'test': 'blah', 'something': '2'})
     c = copy(d)
     c['blah'] = 'blah'
     assert d != c
コード例 #5
0
 def test_set_value(self):
     with raises(TypeError):
         d = ImmutableDict()
         d['something'] = 'test'
コード例 #6
0
ファイル: test_datastructures.py プロジェクト: enigma/watson
 def test_create(self):
     d = ImmutableDict({'test': 'blah', 'something': '2'})
     assert d.__len__() == 2
コード例 #7
0
 def test_create(self):
     d = ImmutableDict({'test': 'blah', 'something': '2'})
     assert len(d) == 2
コード例 #8
0
 def test_clear(self):
     d = ImmutableDict({'test': 'blah', 'something': '2'})
     d.clear()
コード例 #9
0
 def test_delete(self):
     d = ImmutableDict({'test': 'blah', 'something': '2'})
     del d['test']
コード例 #10
0
ファイル: test_datastructures.py プロジェクト: enigma/watson
 def test_deep_copy(self):
     d = ImmutableDict({'test': 'blah', 'something': '2'})
     d2 = deepcopy(d)
     d3 = d.copy()
     assert d == d2
     assert d == d3
コード例 #11
0
 def test_set_value(self):
     d = ImmutableDict()
     d['something'] = 'test'
コード例 #12
0
 def test_clear(self):
     with raises(TypeError):
         d = ImmutableDict({'test': 'blah', 'something': '2'})
         d.clear()