def test_get_id(self): self.assertEqual(4, utils.get_id(4)) class TmpObject(object): uuid = 4 self.assertEqual(4, utils.get_id(TmpObject))
def delete(self, resource): return self._delete(FAKE_RESOURCE_ITEM_URL % utils.get_id(resource))
def update_all(self, resource, **kwargs): resource_url = FAKE_RESOURCE_ITEM_URL % utils.get_id(resource) return self._update_all(resource_url, resource, **kwargs)
def update(self, resource, **kwargs): return self._update(FAKE_RESOURCE_ITEM_URL % utils.get_id(resource), resource, **kwargs)
def get(self, resource, **kwargs): resource_url = FAKE_RESOURCE_ITEM_URL % utils.get_id(resource) return self._get(resource_url, **kwargs)