예제 #1
0
def test_parse_custom_class_path():
    expected = {
        "project": "octopus",
        "location": "oyster",
        "custom_class": "nudibranch",
    }
    path = SpeechClient.custom_class_path(**expected)

    # Check that the path construction is reversible.
    actual = SpeechClient.parse_custom_class_path(path)
    assert expected == actual
예제 #2
0
def test_custom_class_path():
    project = "squid"
    location = "clam"
    custom_class = "whelk"

    expected = "projects/{project}/locations/{location}/customClasses/{custom_class}".format(
        project=project,
        location=location,
        custom_class=custom_class,
    )
    actual = SpeechClient.custom_class_path(project, location, custom_class)
    assert expected == actual