MCPcopy Create free account
hub / github.com/apache/qpid-proton / testPropertyDict

Method testPropertyDict

python/tests/proton_tests/codec.py:245–260  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

243 self._testArray("long", 0, "null")
244
245 def testPropertyDict(self):
246 a = PropertyDict(one=1, two=2, three=3)
247 b = PropertyDict({'one': 1, 'two': 2, 'three': 3})
248 c = PropertyDict(zip(['one', 'two', 'three'], [1, 2, 3]))
249 d = PropertyDict([('two', 2), ('one', 1), ('three', 3)])
250 e = PropertyDict({symbol('three'): 3, symbol('one'): 1, symbol('two'): 2})
251 f = PropertyDict(a)
252 g = PropertyDict()
253 g['one'] = 1
254 g[symbol('two')] = 2
255 g['three'] = 3
256 assert a == b == c == d == e == f == g
257 for k in a.keys():
258 assert isinstance(k, symbol)
259 self.assertRaises(KeyError, AnnotationDict, {'one': 1, None: 'none'})
260 self.assertRaises(KeyError, AnnotationDict, {'one': 1, 1.23: 4})
261
262 def testPropertyDictNoRaiseError(self):
263 a = PropertyDict(one=1, two=2, three=3, raise_on_error=False)

Callers

nothing calls this directly

Calls 3

PropertyDictClass · 0.90
symbolClass · 0.90
assertRaisesMethod · 0.80

Tested by

no test coverage detected