Revision ec3a7362 test/py/cmdlib/instance_unittest.py

b/test/py/cmdlib/instance_unittest.py
39 39
from ganeti.rpc import node as rpc
40 40
from ganeti import utils
41 41
from ganeti.cmdlib import instance
42
from ganeti.cmdlib import instance_utils
42 43

  
43 44
from cmdlib.cmdlib_unittest import _StubComputeIPolicySpecViolation, _FakeLU
44 45

  
......
743 744
class TestCheckOSVariant(CmdlibTestCase):
744 745
  def testNoVariantsSupported(self):
745 746
    os = self.cfg.CreateOs(supported_variants=[])
746
    self.assertRaises(errors.OpPrereqError, instance._CheckOSVariant,
747
    self.assertRaises(errors.OpPrereqError, instance_utils._CheckOSVariant,
747 748
                      os, "os+variant")
748 749

  
749 750
  def testNoVariantGiven(self):
750 751
    os = self.cfg.CreateOs(supported_variants=["default"])
751
    self.assertRaises(errors.OpPrereqError, instance._CheckOSVariant,
752
    self.assertRaises(errors.OpPrereqError, instance_utils._CheckOSVariant,
752 753
                      os, "os")
753 754

  
754 755
  def testWrongVariantGiven(self):
755 756
    os = self.cfg.CreateOs(supported_variants=["default"])
756
    self.assertRaises(errors.OpPrereqError, instance._CheckOSVariant,
757
    self.assertRaises(errors.OpPrereqError, instance_utils._CheckOSVariant,
757 758
                      os, "os+wrong_variant")
758 759

  
759 760
  def testOkWithVariant(self):
760 761
    os = self.cfg.CreateOs(supported_variants=["default"])
761
    instance._CheckOSVariant(os, "os+default")
762
    instance_utils._CheckOSVariant(os, "os+default")
762 763

  
763 764
  def testOkWithoutVariant(self):
764 765
    os = self.cfg.CreateOs(supported_variants=[])
765
    instance._CheckOSVariant(os, "os")
766
    instance_utils._CheckOSVariant(os, "os")
766 767

  
767 768

  
768 769
class TestCheckTargetNodeIPolicy(TestLUInstanceCreate):

Also available in: Unified diff