def MockDoMunkiAuth(self, fail=False, and_return=None, **kwargs):
    """Mock calling gaeserver.DoMunkiAuth().

    Args:
      fail: bool, whether to fail or not; calls AndRaise()
      and_return: any, variable to pass to AndReturn, default None
      kwargs: other options, like require_level=int
    """
    munki_auth_module = self.GetTestClassModule().gaeserver
    if not hasattr(munki_auth_module, 'DoMunkiAuth'):
      raise NotImplementedError('MockDoMunkiAuth for non-Munki handler class')
    if self._set_mock not in 'authDoMunkiAuth':
      self.mox.StubOutWithMock(munki_auth_module, 'DoMunkiAuth')
      self._set_mock['authDoMunkiAuth'] = 1
    if fail:
      self.GetTestClassModule().gaeserver.DoMunkiAuth(**kwargs).AndRaise(
          munki_auth_module.NotAuthenticated)
    else:
      self.GetTestClassModule().gaeserver.DoMunkiAuth(**kwargs).AndReturn(
          and_return)
dataset/ETHPy150Open google/simian/src/tests/simian/mac/common/test.py/RequestHandlerTest.MockDoMunkiAuth/swapped operands of `not in`