Revision ebeb600f test/ganeti.rapi.client_unittest.py

b/test/ganeti.rapi.client_unittest.py
396 396
    self.assertItems(["instance-moo"])
397 397
    self.assertQuery("disks", None)
398 398

  
399
  def testPrepareExport(self):
400
    self.rapi.AddResponse("8326")
401
    self.assertEqual(8326, self.client.PrepareExport("inst1", "local"))
402
    self.assertHandler(rlib2.R_2_instances_name_prepare_export)
403
    self.assertItems(["inst1"])
404
    self.assertQuery("mode", ["local"])
405

  
406
  def testExportInstance(self):
407
    self.rapi.AddResponse("19695")
408
    job_id = self.client.ExportInstance("inst2", "local", "nodeX",
409
                                        shutdown=True)
410
    self.assertEqual(job_id, 19695)
411
    self.assertHandler(rlib2.R_2_instances_name_export)
412
    self.assertItems(["inst2"])
413

  
414
    data = serializer.LoadJson(self.http.last_request.data)
415
    self.assertEqual(data["mode"], "local")
416
    self.assertEqual(data["destination"], "nodeX")
417
    self.assertEqual(data["shutdown"], True)
418

  
399 419
  def testGetJobs(self):
400 420
    self.rapi.AddResponse('[ { "id": "123", "uri": "\\/2\\/jobs\\/123" },'
401 421
                          '  { "id": "124", "uri": "\\/2\\/jobs\\/124" } ]')

Also available in: Unified diff