Пример #1
0
 def device_info(self, req, **args):
     try:
         args['query_params'] = req.GET
         if worker.type == SYNCHRONOUS_WORKER:
             result = core_api.device_info(args)
             return {'devices': result}
     except exception.NotFound:
         msg = "Element not found"
         logger.debug(msg)
         raise webob.exc.HTTPNotFound(msg)
     except exception.NotAuthorized:
         msg = _("Unauthorized access")
         logger.debug(msg)
         raise webob.exc.HTTPForbidden(msg)
     return {'devices': list}
Пример #2
0
 def test_device_info(self):
     params = {'query_params': 2}
     res = 1
     res = api.device_info(params)
     self.assertEquals(res, None, "Alyarma!")