Revision 42d4d8b9 test/ganeti.rapi.rlib2_unittest.py
b/test/ganeti.rapi.rlib2_unittest.py | ||
---|---|---|
272 | 272 |
self.assertRaises(IndexError, cl.GetNextSubmittedJob) |
273 | 273 |
|
274 | 274 |
|
275 |
class TestNodePowercycle(unittest.TestCase): |
|
276 |
def test(self): |
|
277 |
clfactory = _FakeClientFactory(_FakeClient) |
|
278 |
handler = _CreateHandler(rlib2.R_2_nodes_name_powercycle, ["node20744"], { |
|
279 |
"force": ["1"], |
|
280 |
}, None, clfactory) |
|
281 |
job_id = handler.POST() |
|
282 |
|
|
283 |
cl = clfactory.GetNextClient() |
|
284 |
self.assertRaises(IndexError, clfactory.GetNextClient) |
|
285 |
|
|
286 |
(exp_job_id, (op, )) = cl.GetNextSubmittedJob() |
|
287 |
self.assertEqual(job_id, exp_job_id) |
|
288 |
self.assertTrue(isinstance(op, opcodes.OpNodePowercycle)) |
|
289 |
self.assertEqual(op.node_name, "node20744") |
|
290 |
self.assertTrue(op.force) |
|
291 |
|
|
292 |
self.assertRaises(IndexError, cl.GetNextSubmittedJob) |
|
293 |
|
|
294 |
|
|
275 | 295 |
class TestGroupAssignNodes(unittest.TestCase): |
276 | 296 |
def test(self): |
277 | 297 |
clfactory = _FakeClientFactory(_FakeClient) |
Also available in: Unified diff