Revision 51a95d00 test/py/ganeti.hypervisor.hv_xen_unittest.py
b/test/py/ganeti.hypervisor.hv_xen_unittest.py | ||
---|---|---|
97 | 97 |
hv = hv_xen.XenHypervisor(_cmd="invalidcommand") |
98 | 98 |
self.assertRaises(errors.ProgrammerError, hv._GetCommand, None) |
99 | 99 |
|
100 |
def testCommandHvparams(self): |
|
101 |
expected_cmd = "xl" |
|
102 |
test_hvparams = {constants.HV_XEN_CMD: constants.XEN_CMD_XL} |
|
103 |
hv = hv_xen.XenHypervisor() |
|
104 |
self.assertEqual(hv._GetCommand(hvparams=test_hvparams), expected_cmd) |
|
105 |
|
|
106 |
def testCommandHvparamsInvalid(self): |
|
107 |
test_hvparams = {} |
|
108 |
hv = hv_xen.XenHypervisor() |
|
109 |
self.assertRaises(KeyError, hv._GetCommand, test_hvparams) |
|
110 |
|
|
111 |
def testCommandHvparamsCmdInvalid(self): |
|
112 |
test_hvparams = {constants.HV_XEN_CMD: "invalidcommand"} |
|
113 |
hv = hv_xen.XenHypervisor() |
|
114 |
self.assertRaises(errors.ProgrammerError, hv._GetCommand, test_hvparams) |
|
115 |
|
|
100 | 116 |
|
101 | 117 |
class TestParseXmList(testutils.GanetiTestCase): |
102 | 118 |
def test(self): |
Also available in: Unified diff