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

Method testSymbolList

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

Source from the content-addressed store, hash-verified

314 assert a == b == c == d == e == f == g
315
316 def testSymbolList(self):
317 a = SymbolList(['one', 'two', 'three'])
318 b = SymbolList([symbol('one'), symbol('two'), symbol('three')])
319 c = SymbolList()
320 c.append('one')
321 c.extend([symbol('two'), 'three'])
322 d1 = SymbolList(['one'])
323 d2 = SymbolList(['two', symbol('three')])
324 d = d1 + d2
325 e = SymbolList(['one'])
326 e += SymbolList(['two', symbol('three')])
327 f = SymbolList(['one', 'hello', 'goodbye'])
328 f[1] = symbol('two')
329 f[2] = 'three'
330 g = SymbolList(a)
331 assert a == b == c == d == e == f == g
332 for v in a:
333 assert isinstance(v, symbol)
334 self.assertRaises(TypeError, SymbolList, ['one', None])
335 self.assertRaises(TypeError, SymbolList, ['one', 2])
336 self.assertRaises(TypeError, SymbolList, ['one', ['two']])
337 self.assertRaises(TypeError, SymbolList, ['one', {'two': 3}])
338
339 def testSymbolListNoRaiseError(self):
340 a = SymbolList(['one', 'two', 'three', 4], raise_on_error=False)

Callers

nothing calls this directly

Calls 5

appendMethod · 0.95
extendMethod · 0.95
SymbolListClass · 0.90
symbolClass · 0.90
assertRaisesMethod · 0.80

Tested by

no test coverage detected