Beispiel #1
0
def test_can_create_resource_template_from_empty_string():
    template = ResourceTemplate("")
    assert template.uri_template == URITemplate("")
    assert not bool(template)
    assert str(template) == "<>"
Beispiel #2
0
def test_can_create_resource_template_from_uri_template():
    uri_template = URITemplate("http://example.com/foo/{bar}")
    template = ResourceTemplate(uri_template)
    assert template.uri_template == uri_template
    assert bool(template)
    assert str(template) == "<http://example.com/foo/{bar}>"
Beispiel #3
0
def test_can_create_none_resource_template():
    template = ResourceTemplate(None)
    assert template.uri_template == URITemplate(None)
    assert not bool(template)
    assert str(template) == "<>"
Beispiel #4
0
def test_can_create_resource_template_from_empty_uri_template():
    uri_template = URITemplate("")
    template = ResourceTemplate(uri_template)
    assert template.uri_template == uri_template
    assert not bool(template)
    assert str(template) == "<>"