Revision 3ce9a5e7 test/ganeti.opcodes_unittest.py
b/test/ganeti.opcodes_unittest.py | ||
---|---|---|
47 | 47 |
self.assert_(len(cls.OP_ID) > 3) |
48 | 48 |
self.assertEqual(cls.OP_ID, cls.OP_ID.upper()) |
49 | 49 |
self.assertEqual(cls.OP_ID, opcodes._NameToId(cls.__name__)) |
50 |
self.assertFalse(compat.any(cls.OP_ID.startswith(prefix) |
|
51 |
for prefix in opcodes._SUMMARY_PREFIX.keys())) |
|
50 | 52 |
|
51 | 53 |
self.assertRaises(TypeError, cls, unsupported_parameter="some value") |
52 | 54 |
|
... | ... | |
102 | 104 |
self.assertEqual(OpTest(data="node1.example.com").Summary(), |
103 | 105 |
"TEST(node1.example.com)") |
104 | 106 |
|
107 |
def testTinySummary(self): |
|
108 |
self.assertFalse(utils.FindDuplicates(opcodes._SUMMARY_PREFIX.values())) |
|
109 |
self.assertTrue(compat.all(prefix.endswith("_") and supplement.endswith("_") |
|
110 |
for (prefix, supplement) in |
|
111 |
opcodes._SUMMARY_PREFIX.items())) |
|
112 |
|
|
113 |
self.assertEqual(opcodes.OpClusterPostInit().TinySummary(), "C_POST_INIT") |
|
114 |
self.assertEqual(opcodes.OpNodeRemove().TinySummary(), "N_REMOVE") |
|
115 |
self.assertEqual(opcodes.OpInstanceMigrate().TinySummary(), "I_MIGRATE") |
|
116 |
self.assertEqual(opcodes.OpGroupQuery().TinySummary(), "G_QUERY") |
|
117 |
self.assertEqual(opcodes.OpTestJqueue().TinySummary(), "TEST_JQUEUE") |
|
118 |
|
|
105 | 119 |
def testListSummary(self): |
106 | 120 |
class OpTest(opcodes.OpCode): |
107 | 121 |
OP_DSC_FIELD = "data" |
Also available in: Unified diff