예제 #1
0
 def testMapActionInfoToDict(self):
     """Test mapping a manager.ACTION_INFO to a dict."""
     actioninfo = manager.ACTION_INFO('test', 'test', [1], {'a': 1})
     expect = {
         'action': 'test',
         'info': 'test',
         'args': [1],
         'kwargs': {
             'a': 1
         }
     }
     self.assertEquals(expect, manager.MapActionInfoToDict(actioninfo))
예제 #2
0
    def ActionInfo(self, service, healthcheck, action):
        """Return usage and argument information for |action|.

    Args:
      service: A string. The name of a service being monitored.
      healthcheck: A string. The name of the healthcheck the action belongs to.
      action: A string. The name of an action specified by some healthcheck's
        Diagnose method.

    Returns:
      TBD
    """
        result = self.checkfile_manager.ActionInfo(service, healthcheck,
                                                   action)
        return json.dumps(manager.MapActionInfoToDict(result))