

def test_groups(tempfiles):
    config = '    files:\n      - {dir}/dir/[ab].log\n      - group1:\n          - {dir}/[12].log\n      - group2:\n          - {dir}/3.log\n    '.format(dir=tempfiles.dir)
    cfg = parseconfig(textwrap.dedent(config))
    assert (cfg['port'] == 8080)
    assert (cfg['addr'] == 'localhost')
    a1 = set((pjoin(tempfiles.dir, i) for i in ('dir/a.log', 'dir/b.log')))
    a2 = set(cfg['files']['__ungrouped__'])
    assert (a1 == a2)
    b1 = set((pjoin(tempfiles.dir, i) for i in ('1.log', '2.log')))
    b2 = set(cfg['files']['group1'])
    assert (b1 == b2)
    c1 = {pjoin(tempfiles.dir, '3.log')}
    c2 = set(cfg['files']['group2'])
    assert (c1 == c2)

dataset/ETHPy150Open gvalkov/tailon/tests/test_config.py test_groups/original