Revision 7b3df961 test/ganeti.rapi.rlib2_unittest.py
b/test/ganeti.rapi.rlib2_unittest.py | ||
---|---|---|
318 | 318 |
self.assertRaises(IndexError, cl.GetNextSubmittedJob) |
319 | 319 |
|
320 | 320 |
|
321 |
class TestInstanceInfo(unittest.TestCase): |
|
322 |
def test(self): |
|
323 |
clfactory = _FakeClientFactory(_FakeClient) |
|
324 |
handler = _CreateHandler(rlib2.R_2_instances_name_info, ["inst31217"], { |
|
325 |
"static": ["1"], |
|
326 |
}, {}, clfactory) |
|
327 |
job_id = handler.GET() |
|
328 |
|
|
329 |
cl = clfactory.GetNextClient() |
|
330 |
self.assertRaises(IndexError, clfactory.GetNextClient) |
|
331 |
|
|
332 |
(exp_job_id, (op, )) = cl.GetNextSubmittedJob() |
|
333 |
self.assertEqual(job_id, exp_job_id) |
|
334 |
self.assertTrue(isinstance(op, opcodes.OpInstanceQueryData)) |
|
335 |
self.assertEqual(op.instances, ["inst31217"]) |
|
336 |
self.assertTrue(op.static) |
|
337 |
|
|
338 |
self.assertRaises(IndexError, cl.GetNextSubmittedJob) |
|
339 |
|
|
340 |
|
|
321 | 341 |
class TestParseInstanceCreateRequestVersion1(testutils.GanetiTestCase): |
322 | 342 |
def setUp(self): |
323 | 343 |
testutils.GanetiTestCase.setUp(self) |
Also available in: Unified diff