def test_no_overrides(self, ob):
     ns, override = canonicalize_namespaces(self.namespaces, ['resource'])
     self.assertEqual(
         (ns, override),
         ([
             {'name': 'ns1',
              'cluster': {'name': 'cs1'},
              'managedResourceTypes': ['Template'],
              'openshiftResources': [
                  {
                      'provider': 'resource',
                      'path': '/some/path.yml'
                  }
              ]
              }
         ],
             None
         ))
 def test_secret(self, ob):
     ns, override = canonicalize_namespaces(
         self.namespaces, ['vault-secret'])
     self.assertEqual(
         (ns, override),
         ([
             {'name': 'ns1',
              'cluster': {'name': 'cs1'},
              'managedResourceTypes': ['Template'],
              'openshiftResources': [
                  {
                      'provider': 'vault-secret',
                      'path': '/secret/place.yml',
                  }
              ]
              }
         ],
             ['Secret']
         ))
Ejemplo n.º 3
0
 def test_no_overrides(self, ob):
     ns, override = canonicalize_namespaces(self.namespaces, ["resource"])
     self.assertEqual(
         (ns, override),
         (
             [{
                 "name":
                 "ns1",
                 "cluster": {
                     "name": "cs1"
                 },
                 "managedResourceTypes": ["Template"],
                 "openshiftResources": [{
                     "provider": "resource",
                     "path": "/some/path.yml"
                 }],
             }],
             None,
         ),
     )
Ejemplo n.º 4
0
 def test_route(self, ob):
     ns, override = canonicalize_namespaces(self.namespaces, ["route"])
     self.assertEqual(
         (ns, override),
         (
             [{
                 "name":
                 "ns1",
                 "cluster": {
                     "name": "cs1"
                 },
                 "managedResourceTypes": ["Template"],
                 "openshiftResources": [{
                     "provider": "route",
                     "path": "/route/network.yml"
                 }],
             }],
             ["Route"],
         ),
     )
Ejemplo n.º 5
0
 def test_secret(self, ob):
     ns, override = canonicalize_namespaces(self.namespaces,
                                            ["vault-secret"])
     self.assertEqual(
         (ns, override),
         (
             [{
                 "name":
                 "ns1",
                 "cluster": {
                     "name": "cs1"
                 },
                 "managedResourceTypes": ["Template"],
                 "openshiftResources": [{
                     "provider": "vault-secret",
                     "path": "/secret/place.yml",
                 }],
             }],
             ["Secret"],
         ),
     )
 def test_route(self, ob):
     ns, override = canonicalize_namespaces(
         self.namespaces, ['route']
     )
     self.assertEqual(
         (ns, override),
         ([
             {
                 'name': 'ns1',
                 'cluster': {'name': 'cs1'},
                 'managedResourceTypes': ['Template'],
                 'openshiftResources': [
                     {
                         'provider': 'route',
                         'path': '/route/network.yml'
                     }
                 ]
             }
         ],
             ['Route']
         ))