def MockModelStaticBase(self, model_name, method_name, *args):
    """Mock a model static method, return a mock setup.

    Args:
      model_name: str, name of model
      method_name: str, name of static method on model to call
      *args: optional, list of arguments to supply to mock setup
    Returns:
      a mock setup ready for completion with AndReturn, AndRaise, etc.
    """
    test_class_models = self.GetTestClassModule().models
    model_class = getattr(test_class_models, model_name)
    if '%s:%s' % (model_name, method_name) not in self._set_mock:
      mock_model = self.mox.CreateMock(getattr(model_class, method_name))
      self.stubs.Set(model_class, method_name, mock_model)
      self._set_mock['%s:%s' % (model_name, method_name)] = mock_model
    return getattr(model_class, method_name)(*args)
dataset/ETHPy150Open google/simian/src/tests/simian/mac/common/test.py/RequestHandlerTest.MockModelStaticBase/original