def test_dir_resource(): """ dir(resource) should only be based on the embedded links. """ fakey = {'foo': '/foo', 'bar': '/path/to/bar'} res = Resource() res._links = fakey assert set(fakey.keys()) == set(dir(res))
def test_real_resource_attr(): """ Resource objects should allow access to attrs named after links. """ fakey = {'foo': '/foo', 'bar': '/path/to/bar'} res = Resource() res._links = fakey res.foo res.bar