def test_can_create_resource_template_from_empty_string(): template = ResourceTemplate("") assert template.uri_template == URITemplate("") assert not bool(template) assert str(template) == "<>"
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}>"
def test_can_create_none_resource_template(): template = ResourceTemplate(None) assert template.uri_template == URITemplate(None) assert not bool(template) assert str(template) == "<>"
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) == "<>"