def test_is_dynamic_resource_dynamic(self): resource = Mock(path='/{id}') assert utils.is_dynamic_resource(resource)
def test_is_dynamic_resource_not_dynamic(self): resource = Mock(path='/stories') assert not utils.is_dynamic_resource(resource)
def test_is_dynamic_resource_no_resource(self): assert not utils.is_dynamic_resource(None)
def test_is_dynamic_resource_no_resources(self): resource = Mock() parent = Mock(resources=None) resource.parentResource = parent assert not utils.is_dynamic_resource(resource)
def test_is_dynamic_resource_not_dynamic(self): resource = Mock() parent = Mock(resources={'/items': resource}) resource.parentResource = parent assert not utils.is_dynamic_resource(resource)
def test_is_dynamic_resource(self): resource = Mock() parent = Mock(resources={'/{id}': resource}) resource.parentResource = parent assert utils.is_dynamic_resource(resource)
def test_is_dynamic_resource_no_parent(self): resource = Mock(parentResource=None) assert not utils.is_dynamic_resource(resource)