Exemple #1
0
    def setUp(self):
        self.options = [Option("--cls", cf=("config", "cls"),
                               action=ImportComponentAction),
                        Option("--module", action=ImportModuleAction)]

        self.result = argparse.Namespace()
        new_parser()
        self.parser = get_parser(components=[self], namespace=self.result)
Exemple #2
0
    def setUp(self):
        OptionTestCase.setUp(self)
        self.options = [
            Option("--parent", type=Types.comma_list,
                   default=["one", "two"], action=ParentComponentAction)]

        self.result = argparse.Namespace()
        new_parser()
        self.parser = get_parser(components=[self], namespace=self.result,
                                 description="component testing parser")
Exemple #3
0
    def setUp(self):
        self.options = [
            Option("--cls", cf=("config", "cls"),
                   action=ImportComponentAction),
            Option("--module", action=ImportModuleAction)
        ]

        self.result = argparse.Namespace()
        new_parser()
        self.parser = get_parser(components=[self], namespace=self.result)
Exemple #4
0
 def setUp(self):
     self.options = [
         PathOption(cf=("test", "config2"), action=ConfigFileAction),
         PathOption(cf=("test", "config3"), action=ConfigFileAction),
         Option(cf=("test", "foo")),
         Option(cf=("test", "bar")),
         Option(cf=("test", "baz"))]
     self.results = argparse.Namespace()
     new_parser()
     self.parser = get_parser(components=[self], namespace=self.results)
Exemple #5
0
 def setUp(self):
     self.options = [
         PathOption(cf=("test", "config2"), action=ConfigFileAction),
         PathOption(cf=("test", "config3"), action=ConfigFileAction),
         Option(cf=("test", "foo")),
         Option(cf=("test", "bar")),
         Option(cf=("test", "baz"))
     ]
     self.results = argparse.Namespace()
     new_parser()
     self.parser = get_parser(components=[self], namespace=self.results)
Exemple #6
0
 def setUp(self):
     self.options = [
         WildcardSectionGroup(Option(cf=("four:*", "foo")),
                              Option(cf=("four:*", "bar"))),
         WildcardSectionGroup(Option(cf=("five:*", "foo")),
                              Option(cf=("five:*", "bar")),
                              prefix="",
                              dest="sections")
     ]
     self.results = argparse.Namespace()
     new_parser()
     self.parser = get_parser(components=[self], namespace=self.results)
Exemple #7
0
 def setUp(self):
     self.options = [
         WildcardSectionGroup(
             Option(cf=("four:*", "foo")),
             Option(cf=("four:*", "bar"))),
         WildcardSectionGroup(
             Option(cf=("five:*", "foo")),
             Option(cf=("five:*", "bar")),
             prefix="",
             dest="sections")]
     self.results = argparse.Namespace()
     new_parser()
     self.parser = get_parser(components=[self], namespace=self.results)
Exemple #8
0
    def setUp(self):
        OptionTestCase.setUp(self)
        self.options = [
            Option("--parent",
                   type=Types.comma_list,
                   default=["one", "two"],
                   action=ParentComponentAction)
        ]

        self.result = argparse.Namespace()
        new_parser()
        self.parser = get_parser(components=[self],
                                 namespace=self.result,
                                 description="component testing parser")
Exemple #9
0
    def setUp(self):
        self.registry = CommandRegistry()

        self.one = local_subclass(One)
        self.two = local_subclass(Two)

        self.registry.register_command(self.one)
        self.registry.register_command(self.two)

        self.result = argparse.Namespace()
        Bcfg2.Options.Subcommands.master_setup = self.result

        new_parser()
        self.parser = get_parser(namespace=self.result, components=[self])
        self.parser.add_options(self.registry.subcommand_options)
Exemple #10
0
    def setUp(self):
        self.registry = CommandRegistry()

        self.one = local_subclass(One)
        self.two = local_subclass(Two)

        self.registry.register_command(self.one)
        self.registry.register_command(self.two)

        self.result = argparse.Namespace()
        Bcfg2.Options.Subcommands.master_setup = self.result

        new_parser()
        self.parser = get_parser(namespace=self.result,
                                 components=[self])
        self.parser.add_options(self.registry.subcommand_options)
Exemple #11
0
 def setUp(self):
     self.component_parsed_hook = mock.Mock()
     self.options = [BooleanOption("--early-test", default=False)]
     self.results = argparse.Namespace()
     new_parser()
     self.parser = get_parser(components=[self], namespace=self.results)
Exemple #12
0
 def setUp(self):
     self.component_parsed_hook = mock.Mock()
     self.options = [BooleanOption("--early-test", default=False)]
     self.results = argparse.Namespace()
     new_parser()
     self.parser = get_parser(components=[self], namespace=self.results)