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

Method testLookup

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

Source from the content-addressed store, hash-verified

531 assert data.get_object() == b"foo"
532
533 def testLookup(self):
534 obj = {symbol("key"): u"value",
535 symbol("pi"): 3.14159,
536 symbol("list"): [1, 2, 3, 4]}
537 self.data.put_object(obj)
538 self.data.rewind()
539 self.data.next()
540 self.data.enter()
541 self.data.narrow()
542 assert self.data.lookup("pi")
543 assert self.data.get_object() == 3.14159
544 self.data.rewind()
545 assert self.data.lookup("key")
546 assert self.data.get_object() == u"value"
547 self.data.rewind()
548 assert self.data.lookup("list")
549 assert self.data.get_object() == [1, 2, 3, 4]
550 self.data.widen()
551 self.data.rewind()
552 assert not self.data.lookup("pi")

Callers

nothing calls this directly

Calls 9

symbolClass · 0.90
put_objectMethod · 0.80
enterMethod · 0.80
get_objectMethod · 0.80
rewindMethod · 0.45
nextMethod · 0.45
narrowMethod · 0.45
lookupMethod · 0.45
widenMethod · 0.45

Tested by

no test coverage detected