Revision 72cd5493 test/py/ganeti.opcodes_unittest.py
b/test/py/ganeti.opcodes_unittest.py | ||
---|---|---|
362 | 362 |
def testJobIdList(self): |
363 | 363 |
for i in [[], [(False, "error")], [(False, "")], |
364 | 364 |
[(True, 123), (True, "999")]]: |
365 |
self.assertTrue(opcodes.TJobIdList(i))
|
|
365 |
self.assertTrue(ht.TJobIdList(i))
|
|
366 | 366 |
|
367 | 367 |
for i in ["", [("x", 1)], [[], []], [[False, "", None], [True, 123]]]: |
368 |
self.assertFalse(opcodes.TJobIdList(i))
|
|
368 |
self.assertFalse(ht.TJobIdList(i))
|
|
369 | 369 |
|
370 | 370 |
def testJobIdListOnly(self): |
371 |
self.assertTrue(opcodes.TJobIdListOnly({
|
|
371 |
self.assertTrue(ht.TJobIdListOnly({
|
|
372 | 372 |
constants.JOB_IDS_KEY: [], |
373 | 373 |
})) |
374 |
self.assertTrue(opcodes.TJobIdListOnly({
|
|
374 |
self.assertTrue(ht.TJobIdListOnly({
|
|
375 | 375 |
constants.JOB_IDS_KEY: [(True, "9282")], |
376 | 376 |
})) |
377 | 377 |
|
378 |
self.assertFalse(opcodes.TJobIdListOnly({
|
|
378 |
self.assertFalse(ht.TJobIdListOnly({
|
|
379 | 379 |
"x": None, |
380 | 380 |
})) |
381 |
self.assertFalse(opcodes.TJobIdListOnly({
|
|
381 |
self.assertFalse(ht.TJobIdListOnly({
|
|
382 | 382 |
constants.JOB_IDS_KEY: [], |
383 | 383 |
"x": None, |
384 | 384 |
})) |
385 |
self.assertFalse(opcodes.TJobIdListOnly({
|
|
385 |
self.assertFalse(ht.TJobIdListOnly({
|
|
386 | 386 |
constants.JOB_IDS_KEY: [("foo", "bar")], |
387 | 387 |
})) |
388 |
self.assertFalse(opcodes.TJobIdListOnly({
|
|
388 |
self.assertFalse(ht.TJobIdListOnly({
|
|
389 | 389 |
constants.JOB_IDS_KEY: [("one", "two", "three")], |
390 | 390 |
})) |
391 | 391 |
|
... | ... | |
433 | 433 |
self.assertFalse(fn([[constants.DDM_ADD]])) |
434 | 434 |
|
435 | 435 |
def testNicModifications(self): |
436 |
fn = opcodes.OpInstanceSetParams.TestNicModifications
|
|
436 |
fn = ht.TSetParamsMods(ht.TINicParams)
|
|
437 | 437 |
self._GenericTests(fn) |
438 | 438 |
|
439 | 439 |
for param in constants.INIC_PARAMS: |
... | ... | |
441 | 441 |
self.assertTrue(fn([[constants.DDM_ADD, {param: param}]])) |
442 | 442 |
|
443 | 443 |
def testDiskModifications(self): |
444 |
fn = opcodes.OpInstanceSetParams.TestDiskModifications
|
|
444 |
fn = ht.TSetParamsMods(ht.TIDiskParams)
|
|
445 | 445 |
self._GenericTests(fn) |
446 | 446 |
|
447 | 447 |
for param in constants.IDISK_PARAMS: |
Also available in: Unified diff