Revision e5ff1a47 test/ganeti.rapi.rlib2_unittest.py
b/test/ganeti.rapi.rlib2_unittest.py | ||
---|---|---|
1734 | 1734 |
self.assertEqual(result, cl.cluster_info) |
1735 | 1735 |
|
1736 | 1736 |
|
1737 |
class TestInstancesMultiAlloc(unittest.TestCase): |
|
1738 |
def testInstanceUpdate(self): |
|
1739 |
clfactory = _FakeClientFactory(_FakeClient) |
|
1740 |
data = { |
|
1741 |
"instances": [{ |
|
1742 |
"instance_name": "bar", |
|
1743 |
"mode": "create", |
|
1744 |
}, { |
|
1745 |
"instance_name": "foo", |
|
1746 |
"mode": "create", |
|
1747 |
}], |
|
1748 |
} |
|
1749 |
handler = _CreateHandler(rlib2.R_2_instances_multi_alloc, [], {}, data, |
|
1750 |
clfactory) |
|
1751 |
(body, _) = handler.GetPostOpInput() |
|
1752 |
self.assertTrue(compat.all([inst["OP_ID"] == handler.POST_OPCODE.OP_ID |
|
1753 |
for inst in body["instances"]])) |
|
1754 |
|
|
1755 |
|
|
1737 | 1756 |
if __name__ == '__main__': |
1738 | 1757 |
testutils.GanetiTestProgram() |
Also available in: Unified diff