当前位置: 首页>>代码示例>>Python>>正文


Python mox.MoxTestBase方法代码示例

本文整理汇总了Python中mox.MoxTestBase方法的典型用法代码示例。如果您正苦于以下问题:Python mox.MoxTestBase方法的具体用法?Python mox.MoxTestBase怎么用?Python mox.MoxTestBase使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在mox的用法示例。


在下文中一共展示了mox.MoxTestBase方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: setUp

# 需要导入模块: import mox [as 别名]
# 或者: from mox import MoxTestBase [as 别名]
def setUp(self):
    mox.MoxTestBase.setUp(self)
    self.stubs = stubout.StubOutForTesting() 
开发者ID:google,项目名称:macops,代码行数:5,代码来源:gmacpyutil_test.py

示例2: setUp

# 需要导入模块: import mox [as 别名]
# 或者: from mox import MoxTestBase [as 别名]
def setUp(self):
    mox.MoxTestBase.setUp(self)
    self.stubs = stubout.StubOutForTesting()
    self._SetupFoundation()
    self.asr = applescript.AppleScriptRunner() 
开发者ID:google,项目名称:macops,代码行数:7,代码来源:applescript_test.py

示例3: CoopTestCase

# 需要导入模块: import mox [as 别名]
# 或者: from mox import MoxTestBase [as 别名]
def CoopTestCase(other_base_class):
  """Returns a new base class with a cooperative metaclass base.

  This enables the TestCase to be used in combination
  with other base classes that have custom metaclasses, such as
  mox.MoxTestBase.

  Only works with metaclasses that do not override type.__new__.

  Example:

    import google3
    import mox

    from google3.testing.pybase import parameterized

    class ExampleTest(parameterized.CoopTestCase(mox.MoxTestBase)):
      ...

  Args:
    other_base_class: (class) A test case base class.

  Returns:
    A new class object.
  """
  metaclass = type(
      'CoopMetaclass',
      (other_base_class.__metaclass__,
       TestGeneratorMetaclass), {})
  return metaclass(
      'CoopTestCase',
      (other_base_class, TestCase), {}) 
开发者ID:ryfeus,项目名称:lambda-packs,代码行数:34,代码来源:_parameterized.py

示例4: CoopParameterizedTestCase

# 需要导入模块: import mox [as 别名]
# 或者: from mox import MoxTestBase [as 别名]
def CoopParameterizedTestCase(other_base_class):
  """Returns a new base class with a cooperative metaclass base.

  This enables the ParameterizedTestCase to be used in combination
  with other base classes that have custom metaclasses, such as
  mox.MoxTestBase.

  Only works with metaclasses that do not override type.__new__.

  Example:

    import google3
    import mox

    from google3.testing.pybase import parameterized

    class ExampleTest(parameterized.CoopParameterizedTestCase(mox.MoxTestBase)):
      ...

  Args:
    other_base_class: (class) A test case base class.

  Returns:
    A new class object.
  """
  metaclass = type(
      'CoopMetaclass',
      (other_base_class.__metaclass__,
       TestGeneratorMetaclass), {})
  return metaclass(
      'CoopParameterizedTestCase',
      (other_base_class, ParameterizedTestCase), {}) 
开发者ID:abhisuri97,项目名称:auto-alt-text-lambda-api,代码行数:34,代码来源:_parameterized.py


注:本文中的mox.MoxTestBase方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。