本文整理匯總了Python中wishbone.event.Event.get方法的典型用法代碼示例。如果您正苦於以下問題:Python Event.get方法的具體用法?Python Event.get怎麽用?Python Event.get使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類wishbone.event.Event
的用法示例。
在下文中一共展示了Event.get方法的8個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。
示例1: test_event_slurp
# 需要導入模塊: from wishbone.event import Event [as 別名]
# 或者: from wishbone.event.Event import get [as 別名]
def test_event_slurp():
a = Event()
b = Event()
b.slurp(a.dump())
assert a.get('uuid') == b.get('uuid')
示例2: test_event_get_error
# 需要導入模塊: from wishbone.event import Event [as 別名]
# 或者: from wishbone.event.Event import get [as 別名]
def test_event_get_error():
e = Event({"one": 1, "two": {"three": 3}})
try:
e.get("data.blah")
except KeyError:
assert True
else:
assert False
示例3: test_event_delete
# 需要導入模塊: from wishbone.event import Event [as 別名]
# 或者: from wishbone.event.Event import get [as 別名]
def test_event_delete():
a = Event({"one": 1, "two": 2})
a.delete("data.two")
try:
a.get("data.two")
except KeyError:
assert True
else:
assert False
示例4: test_module_http_ok_server_response
# 需要導入模塊: from wishbone.event import Event [as 別名]
# 或者: from wishbone.event.Event import get [as 別名]
def test_module_http_ok_server_response():
webserver = WebServer()
webserver.start()
actor_config = ActorConfig('httpoutclient', 100, 1, {}, "")
http = HTTPOutClient(actor_config, url="http://localhost:8088/", accept="monkeyballs")
http.pool.queue.inbox.disableFallThrough()
http.start()
e = Event('{"one": 1}')
http.pool.queue.inbox.put(e)
sleep(1)
assert(e.get("@tmp.httpoutclient.server_response_json")["message"] == "hello world!")
http.stop()
webserver.stop()
示例5: test_render_field
# 需要導入模塊: from wishbone.event import Event [as 別名]
# 或者: from wishbone.event.Event import get [as 別名]
def test_render_field():
e = Event({"value": "Hello", "template": "{{data.value}} how are you doing?"})
assert e.get("data.template") == "{{data.value}} how are you doing?"
e.renderField("data.template")
assert e.get("data.template") == "Hello how are you doing?"
示例6: test_event_uuid
# 需要導入模塊: from wishbone.event import Event [as 別名]
# 或者: from wishbone.event.Event import get [as 別名]
def test_event_uuid():
e = Event()
assert e.get('uuid')
示例7: test_event_get_empty_key
# 需要導入模塊: from wishbone.event import Event [as 別名]
# 或者: from wishbone.event.Event import get [as 別名]
def test_event_get_empty_key():
e = Event("hello")
assert e.get(None)["data"] == "hello"
assert e.get("")["data"] == "hello"
assert e.get(".")["data"] == "hello"
示例8: test_event_get
# 需要導入模塊: from wishbone.event import Event [as 別名]
# 或者: from wishbone.event.Event import get [as 別名]
def test_event_get():
e = Event({"one": 1, "two": {"three": 3}})
assert e.get("data.two.three") == 3