def test_iterate_marked(cfg): assert list(iterate_marked(cfg, ConfigSummary())) == \ [('a', ConfigEntry('a', 0, False, False, None)), ('b', ConfigEntry('b', {}, False, False, None)), ('c', PathEntry('c', False, False, None)), ('c.cA', ConfigEntry('cA', 3, False, False, None)), ('c.cB', ConfigEntry('cB', 4, False, False, None)), ('c.cC', PathEntry('cC', False, False, None)), ('c.cC.cC1', ConfigEntry('cC1', 6, False, False, None)), ('d', PathEntry('d', False, False, None)), ('d.dA', ConfigEntry('dA', 8, False, False, None)) ]
def test_iterate_marked_updated(cfg): modified = {'b', 'c', 'c.cC.cC1'} assert list(iterate_marked(cfg, ConfigSummary(modified=modified))) == \ [('a', ConfigEntry('a', 0, False, False, None)), ('b', ConfigEntry('b', {}, False, True, None)), ('c', PathEntry('c', False, True, None)), ('c.cA', ConfigEntry('cA', 3, False, False, None)), ('c.cB', ConfigEntry('cB', 4, False, False, None)), ('c.cC', PathEntry('cC', False, True, None)), ('c.cC.cC1', ConfigEntry('cC1', 6, False, True, None)), ('d', PathEntry('d', False, False, None)), ('d.dA', ConfigEntry('dA', 8, False, False, None)) ]
def test_iterate_marked_typechanged(cfg): typechanged = {'a': (bool, int), 'd.dA': (float, int)} result = list(iterate_marked(cfg, ConfigSummary(typechanged=typechanged))) assert result == \ [('a', ConfigEntry('a', 0, False, False, (bool, int))), ('b', ConfigEntry('b', {}, False, False, None)), ('c', PathEntry('c', False, False, None)), ('c.cA', ConfigEntry('cA', 3, False, False, None)), ('c.cB', ConfigEntry('cB', 4, False, False, None)), ('c.cC', PathEntry('cC', False, False, None)), ('c.cC.cC1', ConfigEntry('cC1', 6, False, False, None)), ('d', PathEntry('d', False, True, None)), ('d.dA', ConfigEntry('dA', 8, False, False, (float, int))) ]