Ejemplo n.º 1
0
 def resource_get(self, resource_id):
     request = self.request
     resource = ResourceService.get(safe_integer(resource_id),
                                    db_session=request.dbsession)
     if not resource:
         raise pyramid.httpexceptions.HTTPNotFound()
     return resource
 def test_get(self, db_session):
     add_resource(db_session, 1, 'root')
     resource = ResourceService.get(resource_id=1, db_session=db_session)
     assert resource.resource_id == 1
     assert resource.resource_name == 'root'