コード例 #1
0
def test_parse_session_entity_type_path():
    expected = {
        "project": "nudibranch",
        "location": "cuttlefish",
        "agent": "mussel",
        "session": "winkle",
        "entity_type": "nautilus",
    }
    path = SessionsClient.session_entity_type_path(**expected)

    # Check that the path construction is reversible.
    actual = SessionsClient.parse_session_entity_type_path(path)
    assert expected == actual
コード例 #2
0
def test_session_entity_type_path():
    project = "squid"
    location = "clam"
    agent = "whelk"
    session = "octopus"
    entity_type = "oyster"

    expected = "projects/{project}/locations/{location}/agents/{agent}/sessions/{session}/entityTypes/{entity_type}".format(
        project=project,
        location=location,
        agent=agent,
        session=session,
        entity_type=entity_type,
    )
    actual = SessionsClient.session_entity_type_path(project, location, agent,
                                                     session, entity_type)
    assert expected == actual