示例#1
0
def patchUtils(module_under_test):
  """Patches the L{ganeti.utils} module for tests.

  This function is meant to be used as a decorator for test methods.

  @type module_under_test: string
  @param module_under_test: the module within cmdlib which is tested. The
        "ganeti.cmdlib" prefix is optional.

  """
  return patchModule(module_under_test, "utils")
def patchIAllocator(module_under_test):
    """Patches the L{ganeti.masterd.iallocator.IAllocator} class for tests.

  This function is meant to be used as a decorator for test methods.

  @type module_under_test: string
  @param module_under_test: the module within cmdlib which is tested. The
        "ganeti.cmdlib" prefix is optional.

  """
    return patchModule(module_under_test, "iallocator.IAllocator")
示例#3
0
def patchIAllocator(module_under_test):
  """Patches the L{ganeti.masterd.iallocator.IAllocator} class for tests.

  This function is meant to be used as a decorator for test methods.

  @type module_under_test: string
  @param module_under_test: the module within cmdlib which is tested. The
        "ganeti.cmdlib" prefix is optional.

  """
  return patchModule(module_under_test, "iallocator.IAllocator")