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

Method testBinaryPropertyKey

python/tests/proton_tests/message.py:178–192  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

176 self._testNonStringPropertyKey(symbol('abcdef'))
177
178 def testBinaryPropertyKey(self):
179 if version_info[0] > 2:
180 # Py3: Binary conversions not supported
181 self._testNonStringPropertyKey(b'abc123')
182 else:
183 # Py2: Check for correct key conversion
184 self.msg.properties = {'abc': 123, b'def': 456}
185 data = self.msg.encode()
186
187 msg2 = Message()
188 msg2.decode(data)
189
190 assert msg2.properties == self.msg.properties
191 for k in msg2.properties:
192 assert type(k) is unicode, 'non-string key %s %s' % (k, type(k))
193
194 def testAnnotationsSymbolicAndUlongKey(self, a=None):
195 if a is None:

Callers

nothing calls this directly

Calls 5

decodeMethod · 0.95
MessageClass · 0.90
typeClass · 0.85
encodeMethod · 0.45

Tested by

no test coverage detected