當前位置: 首頁>>代碼示例>>Python>>正文


Python Event.get方法代碼示例

本文整理匯總了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')
開發者ID:smetj,項目名稱:wishbone,代碼行數:9,代碼來源:test_event.py

示例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
開發者ID:smetj,項目名稱:wishbone,代碼行數:11,代碼來源:test_event.py

示例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
開發者ID:smetj,項目名稱:wishbone,代碼行數:13,代碼來源:test_event.py

示例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()
開發者ID:smetj,項目名稱:wishbone-output-http,代碼行數:19,代碼來源:test_wishbone_output_http.py

示例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?"
開發者ID:smetj,項目名稱:wishbone,代碼行數:8,代碼來源:test_event.py

示例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')
開發者ID:smetj,項目名稱:wishbone,代碼行數:6,代碼來源:test_event.py

示例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"
開發者ID:smetj,項目名稱:wishbone,代碼行數:8,代碼來源:test_event.py

示例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
開發者ID:smetj,項目名稱:wishbone,代碼行數:6,代碼來源:test_event.py


注:本文中的wishbone.event.Event.get方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。