Exemplo n.º 1
0
    def remove_parameters_by_namespace(self, namespace):
        """Removes all parameters in the given namespace.

        :type namespace: str
        """
        self._parameters = [
            p for p in self.parameters
            if not ns_utils.matches_template_namespace(namespace, p.name)]
Exemplo n.º 2
0
    def remove_parameters_by_namespace(self, namespace):
        """Removes all parameters in the given namespace.

        :type namespace: str
        """
        self._parameters = [
            p for p in self.parameters
            if not ns_utils.matches_template_namespace(namespace, p.name)]
Exemplo n.º 3
0
    def remove_outputs_by_namespace(self, namespace):
        """Removes all outputs in the given namespace from the template.

        :type namespace: str
        """
        self._outputs = [
            o for o in self.outputs
            if not ns_utils.matches_template_namespace(namespace, o.name)]
Exemplo n.º 4
0
    def remove_outputs_by_namespace(self, namespace):
        """Removes all outputs in the given namespace from the template.

        :type namespace: str
        """
        self._outputs = [
            o for o in self.outputs
            if not ns_utils.matches_template_namespace(namespace, o.name)]
Exemplo n.º 5
0
    def has_parameter_in_namespace(self, namespace):
        """Returns true if the environment has at least one parameter
        in given namespace, false otherwise.

        :type namespace: str
        """
        for p in self._parameters:
            if ns_utils.matches_template_namespace(namespace, p.name):
                return True
        return False
Exemplo n.º 6
0
    def has_parameter_in_namespace(self, namespace):
        """Returns true if the environment has at least one parameter
        in given namespace, false otherwise.

        :type namespace: str
        """
        for p in self._parameters:
            if ns_utils.matches_template_namespace(namespace, p.name):
                return True
        return False
Exemplo n.º 7
0
 def test_matches_template_namespace(self):
     value = 'test-ns::test-name'
     self.assertTrue(namespace.matches_template_namespace('test-ns', value))
     self.assertFalse(namespace.matches_template_namespace('fake', value))
Exemplo n.º 8
0
 def test_apply_template_namespace(self):
     namespaced = namespace.apply_template_namespace('test-ns', 'test-name')
     self.assertEqual(namespaced, 'test-ns::test-name')
     self.assertTrue(
         namespace.matches_template_namespace('test-ns', namespaced))
Exemplo n.º 9
0
 def test_matches_template_namespace(self):
     value = 'test-ns::test-name'
     self.assertTrue(namespace.matches_template_namespace('test-ns', value))
     self.assertFalse(namespace.matches_template_namespace('fake', value))
Exemplo n.º 10
0
 def test_apply_template_namespace(self):
     namespaced = namespace.apply_template_namespace('test-ns', 'test-name')
     self.assertEqual(namespaced, 'test-ns::test-name')
     self.assertTrue(namespace.matches_template_namespace('test-ns',
                                                          namespaced))