Example #1
0
 def assert_b(v, m=None, i=None):
     six.assertCountEqual(self, InputConfigIdList(v, map_name=m, instances=i),
                          [InputConfigId(ItemType.CONTAINER, 'm', 'c', ('i', )),
                           InputConfigId(ItemType.CONTAINER, 'm', 'd', ('i', )),
                           InputConfigId(ItemType.CONTAINER, 'n', 'e', ('i', 'j'))])
     six.assertCountEqual(self, get_map_config_ids(v, maps, default_map_name=m, default_instances=i),
                          [MapConfigId(ItemType.CONTAINER, 'm', 'c', 'i'),
                           MapConfigId(ItemType.CONTAINER, 'm', 'd', 'i'),
                           MapConfigId(ItemType.CONTAINER, 'n', 'e', 'i'),
                           MapConfigId(ItemType.CONTAINER, 'n', 'e', 'j')])
Example #2
0
 def test_get_map_config_ids_all_alias(self):
     map_m = ContainerMap('m', c1=dict(), c2=dict(), c3=dict(), groups=dict(default=['c3']))
     map_n = ContainerMap('n', c1=dict(), c3=dict(), groups=dict(default=['c3']))
     maps = {'m': map_m, 'n': map_n}
     six.assertCountEqual(self, get_map_config_ids('m.__all__', maps),
                          [MapConfigId(ItemType.CONTAINER, 'm', 'c1'),
                           MapConfigId(ItemType.CONTAINER, 'm', 'c2'),
                           MapConfigId(ItemType.CONTAINER, 'm', 'c3')])
     six.assertCountEqual(self, get_map_config_ids('__all__.__all__', maps),
                          [MapConfigId(ItemType.CONTAINER, 'm', 'c1'),
                           MapConfigId(ItemType.CONTAINER, 'm', 'c2'),
                           MapConfigId(ItemType.CONTAINER, 'm', 'c3'),
                           MapConfigId(ItemType.CONTAINER, 'n', 'c1'),
                           MapConfigId(ItemType.CONTAINER, 'n', 'c3')])
     six.assertCountEqual(self, get_map_config_ids('__all__.c1',maps),
                          [MapConfigId(ItemType.CONTAINER, 'm', 'c1'),
                           MapConfigId(ItemType.CONTAINER, 'n', 'c1')])
     six.assertCountEqual(self, get_map_config_ids('__all__.default', maps),
                          [MapConfigId(ItemType.CONTAINER, 'm', 'c3'),
                           MapConfigId(ItemType.CONTAINER, 'n', 'c3')])
Example #3
0
 def assert_d(v, m=None, i=None):
     six.assertCountEqual(self, expand_groups(InputConfigIdList(v, map_name=m, instances=i), maps),
                          [InputConfigId(ItemType.NETWORK, 'n', 'nn1')])
     six.assertCountEqual(self, get_map_config_ids(v, maps, default_map_name=m, default_instances=i),
                          [MapConfigId(ItemType.NETWORK, 'n', 'nn1')])
Example #4
0
 def assert_a(v, m=None, i=None):
     self.assertEqual(InputConfigIdList(v, map_name=m, instances=i),
                      [InputConfigId(ItemType.CONTAINER, 'm', 'c')])
     self.assertEqual(get_map_config_ids(v, maps, default_map_name=m, default_instances=i),
                      [MapConfigId(ItemType.CONTAINER, 'm', 'c', 'i')])