Exemple #1
0
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))
         ]
Exemple #2
0
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))
         ]
Exemple #3
0
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))
         ]
Exemple #4
0
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))
         ]
Exemple #5
0
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)))
         ]
Exemple #6
0
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)))
         ]