示例#1
0
 def test_get_all_vcenters(self):
     vcenters = vcenter.get_all_vcenters(tests.CONNECTION)
     self.assertIsNotNone(vcenters)
     self.assertIsInstance(vcenters, list)
     d1 = {
         'username': '******',
         'instanceUuid': '137E2125-73EB-4E1B-BF03-2B6CD396E6AC',
         'monitor': 'false',
         'hostname': '172.16.214.129',
         'meter': 'true',
         'version': '5.5.0',
         'active': 'true',
         'fullname': 'VMware vCenter Server 5.5.0 build-1945287 (Sim)',
         'id': '1'
     }
     self.assertDictEqual(d1, vcenters[0])
 def test_get_all_vcenters(self):
     vcenters = vcenter.get_all_vcenters(tests.CONNECTION)
     self.assertIsNotNone(vcenters)
     self.assertIsInstance(vcenters, list)
     d1 = {
         'username': '******',
         'instanceUuid': '137E2125-73EB-4E1B-BF03-2B6CD396E6AC',
         'monitor': 'false',
         'hostname': '172.16.214.129',
         'meter': 'true',
         'version': '5.5.0',
         'active': 'true',
         'fullname': 'VMware vCenter Server 5.5.0 build-1945287 (Sim)',
         'id': '1'
     }
     self.assertDictEqual(d1, vcenters[0])
示例#3
0
 def test_get_all_vcenters(self):
     vcenters = vcenter.get_all_vcenters(tests.CONNECTION)
     self.assertIsNotNone(vcenters)
     self.assertIsInstance(vcenters, list)
     d1 = {
         "username": "******",
         "instanceUuid": "137E2125-73EB-4E1B-BF03-2B6CD396E6AC",
         "monitor": "false",
         "hostname": "172.16.214.129",
         "meter": "true",
         "version": "5.5.0",
         "active": "true",
         "fullname": "VMware vCenter Server 5.5.0 build-1945287 (Sim)",
         "id": "1",
     }
     self.assertDictEqual(d1, vcenters[0])
 def test_get_all_vcenters_no_route_to_host(self):
     bad_connection = Connection(host="null", token="bad")
     with self.assertRaises(vcenter.VCenterException):
         vcenter.get_all_vcenters(bad_connection)
 def test_get_all_vcenters_not_found(self):
     with self.assertRaises(vcenter.VCenterException):
         vcenter.get_all_vcenters(tests.CONNECTION)
示例#6
0
 def test_get_all_vcenters_not_found(self):
     with self.assertRaises(vcenter.VCenterException):
         vcenter.get_all_vcenters(tests.CONNECTION)
示例#7
0
 def test_get_all_vcenters_no_route_to_host(self):
     bad_connection = Connection(host="null", token="bad")
     with self.assertRaises(vcenter.VCenterException):
         vcenter.get_all_vcenters(bad_connection)