def setUp(self) -> None: self.app = Application("sample_app") # client --> comp1 --> comp1-1 --> comp1-1-1 # \ # -> comp1-2 self.client = Component(self.app, "client", "client", ComponentType.UNMANAGED) self.comp1 = Component(self.app, "comp1", "comp1", ComponentType.MANAGED) self.comp1_1 = Component(self.app, "comp1-1", "comp1-1", ComponentType.MANAGED) self.comp1_2 = Component(self.app, "comp1-2", "comp1-2", ComponentType.MANAGED) self.comp1_1_1 = Component(self.app, "comp1-1-1", "comp1-1-1", ComponentType.MANAGED) self._managed_components = [ self.comp1, self.comp1_1, self.comp1_2, self.comp1_1_1 ] self.client.add_dependency(self.comp1) self.comp1.add_dependency(self.comp1_1) self.comp1.add_dependency(self.comp1_2) self.comp1_1.add_dependency(self.comp1_1_1) # Dependencies for client. self._dependencies_in_levels = [[self.comp1], [self.comp1_1, self.comp1_2], [self.comp1_1_1]] self._dependency_chains = [[self.comp1, self.comp1_1, self.comp1_1_1], [self.comp1, self.comp1_2]] self.app.add_components([self.client] + self._managed_components)
def _create_second_application(self): self.second_app = Application("second_application") self.second_component = Component(self.second_app, "second_component", "second_component", ComponentType.MANAGED) self.second_app.add_component(self.second_component) self.second_compin = ManagedCompin(self.second_component, id_="second_compin", node="node", chain_id="2")
def _create_first_application(self): self.app = Application("sample_application") # component1 --> component2 self.component1 = Component(self.app, "component1", "component1", ComponentType.MANAGED) self.component2 = Component(self.app, "component2", "component2", ComponentType.MANAGED) self.component1.add_dependency(self.component2) self.app.add_components([self.component1, self.component2]) # Note there is no dependency between compins on purpose. self.compin1 = ManagedCompin(self.component1, id_="compin1", node="node", chain_id="1") self.compin2 = ManagedCompin(self.component2, id_="compin2", node="node", chain_id="1")
def setUp(self) -> None: self.app = Application("sample_app") # client --> comp1 --> comp2 --> comp3 self.client = Component(self.app, "client", "client", ComponentType.UNMANAGED) self.comp1 = Component(self.app, "comp1", "comp1", ComponentType.MANAGED) self.comp2 = Component(self.app, "comp2", "comp2", ComponentType.MANAGED) self.comp3 = Component(self.app, "comp3", "comp3", ComponentType.MANAGED) self.client.add_dependency(self.comp1) self.comp1.add_dependency(self.comp2) self.comp2.add_dependency(self.comp3) self.managed_components = [self.comp1, self.comp2, self.comp3] self.unmanaged_components = [self.client] self.app.add_components( [self.client, self.comp1, self.comp2, self.comp3])