コード例 #1
0
def test_can_use_resource_with_template_uri():
    resource_tmpl = ResourceTemplate("http://localhost:8080/person/{name}")
    for name in PEOPLE.keys():
        with resource_tmpl.expand(name=name).get() as response:
            assert isinstance(response, JSONResponse)
            assert assembled(response) == PEOPLE[name]
コード例 #2
0
ファイル: http_test.py プロジェクト: zbyufei/httpstream
def test_can_use_resource_with_template_uri():
    resource_tmpl = ResourceTemplate("http://localhost:8080/person/{name}")
    for name in PEOPLE.keys():
        with resource_tmpl.expand(name=name).get() as response:
            assert isinstance(response, JSONResponse)
            assert assembled(response) == PEOPLE[name]
コード例 #3
0
ファイル: resource_test.py プロジェクト: jayvdb/httpstream
def test_can_get_substituted_uri():
    resource = ResourceTemplate("http://localhost:8080/person/{name}")
    rs = resource.expand(name="alice").get()
    assert rs.status_code == 200