def test_directivenode_from_metadata(self):
        params = self._setup_directivenode()
        params.pop("filepath")
        params.pop("name")
        params["metadata"] = {"irrelevant": "value"}

        # Just testing that error from missing required parameters is not raised
        util.directivenode_kwargs(params)
Example #2
0
 def __init__(self, **kwargs):
     name, parameters, enabled, kwargs = util.directivenode_kwargs(kwargs)
     super(ApacheDirectiveNode, self).__init__(**kwargs)
     self.name = name
     self.parameters = parameters
     self.enabled = enabled
     self.include = None
Example #3
0
 def __init__(self, **kwargs):
     name, parameters, enabled, kwargs = util.directivenode_kwargs(kwargs)
     super(AugeasDirectiveNode, self).__init__(**kwargs)
     self.name = name
     self.enabled = enabled
     if parameters:
         self.set_parameters(parameters)
Example #4
0
 def __init__(self, **kwargs: Any):
     name, parameters, enabled, kwargs = util.directivenode_kwargs(kwargs)
     super().__init__(**kwargs)
     self.name: str = name
     self.enabled: bool = enabled
     if parameters:
         self.set_parameters(parameters)
Example #5
0
 def __init__(self, **kwargs: Any) -> None:
     name, parameters, enabled, kwargs = util.directivenode_kwargs(kwargs)
     super().__init__(**kwargs)
     self.name = name
     self.parameters = parameters
     self.enabled = enabled
     self.include: Optional[str] = None
    def test_directivenode(self):
        params = self._setup_directivenode()
        ctrl = self._setup_directivenode()

        name, parameters, enabled, _ = util.directivenode_kwargs(params)
        self.assertEqual(name, ctrl["name"])
        self.assertEqual(parameters, ctrl["parameters"])
        self.assertEqual(enabled, ctrl["enabled"])
Example #7
0
    def __init__(self, **kwargs):
        """
        Initializes the DirectiveNode instance and sets its instance variables.
        """
        name, parameters, enabled, kwargs = util.directivenode_kwargs(kwargs)
        self.name = name
        self.parameters = parameters
        self.enabled = enabled

        super().__init__(**kwargs)