Пример #1
0
 def add_root(self, component_name, host, features=(), ignore=False):
     compdef = self.components[component_name]
     root = RootComponent(name=compdef.name,
                          environment=self,
                          host=host,
                          features=features,
                          ignore=ignore,
                          factory=compdef.factory,
                          defdir=compdef.defdir,
                          workdir=os.path.join(self.workdir_base,
                                               compdef.name))
     self.root_components.append(root)
     return root
Пример #2
0
def test_root_component_repr():
    host = Mock()
    environment = Mock()
    root = RootComponent('haproxy', environment, host, [], False,
                         object, '/defdir', '/workdir')
    assert repr(root).startswith('<RootComponent "haproxy" object at ')