Exemplo n.º 1
0
    def test_fault_checker_missing_props(self):
        fake_objects = fake.FakeRetrieveResult()
        ml = [fake.MissingProperty(method_fault=ExpectedMethodFault())]
        fake_objects.add_object(fake.ObjectContent(None, missing_list=ml))

        exp_fault_list = ['ExpectedMethodFault']
        try:
            error_util.FaultCheckers.retrievepropertiesex_fault_checker(
                fake_objects)
        except error_util.VimFaultException as e:
            self.assertEqual(exp_fault_list, e.fault_list)
        else:
            self.fail("VimFaultException was not raised.")
Exemplo n.º 2
0
def _fake_get_object_properties_missing(vim, collector, mobj, type,
                                        properties):
    fake_objects = fake.FakeRetrieveResult()
    ml = [fake.MissingProperty()]
    fake_objects.add_object(fake.ObjectContent(None, missing_list=ml))
    return fake_objects