def setUp(self): self.generator = Generator() self.generator.setup_logging() self.hosts = {} self.applications = {} Application.init_classes([ os.path.join(os.path.dirname(__file__), '../recipes/default/classes'), os.path.join(os.path.dirname(__file__), 'recipes/test10/classes')]) MonitoringDetail.init_classes([ os.path.join(os.path.dirname(__file__), '../recipes/default/classes'), os.path.join(os.path.dirname(__file__), 'recipes/test10/classes')]) pass row = ['drivelsrv', '11.120.9.10', 'Server', 'Red Hat 6.0', '', 'vs', '7x24', '2nd floor', 'ps'] final_row = { } for (index, value) in enumerate(['host_name', 'address', 'type', 'os', 'hardware', 'virtual', 'notification_period', 'location', 'department']): final_row[value] = [None if row[index] == "" else row[index]][0] h = Host(final_row) self.hosts[h.host_name] = h row = ['drivel', 'mysql', '', '', '', 'drivelsrv', '7x24'] final_row = { } for (index, value) in enumerate(['name', 'type', 'component', 'version', 'patchlevel', 'host_name', 'check_period']): final_row[value] = [None if row[index] == "" else row[index]][0] a = Application(final_row) #a.__init__(final_row) self.applications[a.fingerprint()] = a setattr(a, "host", self.hosts[a.host_name])