def test_can_create_bindable_with_initial_uri_and_metadata(): uri = "http://localhost:7474/db/data/node/1" metadata = {"foo": "bar"} bindable = Service() bindable.bind(uri, metadata) assert bindable.bound assert bindable.uri == uri assert bindable.resource.metadata == metadata
def test_cannot_create_bindable_with_initial_uri_template_and_metadata(): uri = "http://localhost:7474/db/data/node/{node_id}" metadata = {"foo": "bar"} service = Service() try: service.bind(uri, metadata) except ValueError: assert True else: assert False
def test_can_create_bindable_with_initial_uri_template(): uri = "http://localhost:7474/db/data/node/{node_id}" bindable = Service() bindable.bind(uri) assert bindable.bound assert bindable.uri == uri