def test_intervals():
    assert intervals_from_config('retain\ttest\t6') == {'test': 6}
    assert intervals_from_config('retain\ttest\t6\nretain\tnext\t2') == {
        'test': 6,
        'next': 2
    }

    minimal_config = open('tests/rsnapshot-minimal.conf').read()
    assert intervals_from_config(minimal_config) == {
        'daily': 6,
        'weekly': 7,
        'monthly': 11
    }
def test_no_intervals_given():
    # Simulating faulty config with spaces
    with pytest.raises(ValueError) as excinfo:
        intervals_from_config('retain  daily  9')
    assert 'backup intervals' in str(excinfo.value)
def test_no_intervals_given():
    # Simulating faulty config with spaces
    with pytest.raises(ValueError) as excinfo:
        intervals_from_config('retain  daily  9')
    assert 'backup intervals' in str(excinfo.value)
def test_intervals():
    assert intervals_from_config('retain\ttest\t6') == {'test': 6}
    assert intervals_from_config('retain\ttest\t6\nretain\tnext\t2') == {'test': 6, 'next': 2}

    minimal_config = open('tests/rsnapshot-minimal.conf').read()
    assert intervals_from_config(minimal_config) == {'daily': 6, 'weekly': 7, 'monthly': 11}