Revision b423c513 test/ganeti.hooks_unittest.py

b/test/ganeti.hooks_unittest.py
379 379
  def testConflict(self):
380 380
    for name in ["DATA_DIR", "OP_CODE"]:
381 381
      self.lu.hook_env = { name: "value" }
382

  
383
      # Test using a clean HooksMaster instance
384
      hm = mcpu.HooksMaster(self._HooksRpc, self.lu)
385

  
382 386
      for phase in [constants.HOOKS_PHASE_PRE, constants.HOOKS_PHASE_POST]:
383
        # Test using a clean HooksMaster instance
384
        self.assertRaises(AssertionError,
385
                          mcpu.HooksMaster(self._HooksRpc, self.lu).RunPhase,
386
                          phase)
387
        self.assertRaises(AssertionError, hm.RunPhase, phase)
387 388
        self.assertRaises(IndexError, self._rpcs.pop)
388 389

  
389 390
  def testNoNodes(self):
......
415 416
    self.assertRaises(AssertionError, self.hm.RunConfigUpdate)
416 417
    self.assertRaises(IndexError, self._rpcs.pop)
417 418

  
419
  def testNoPreBeforePost(self):
420
    self.lu.hook_env = {}
421
    self.assertRaises(AssertionError, self.hm.RunPhase,
422
                      constants.HOOKS_PHASE_POST)
423

  
418 424

  
419 425
if __name__ == '__main__':
420 426
  testutils.GanetiTestProgram()

Also available in: Unified diff