コード例 #1
0
ファイル: test_create.py プロジェクト: DanielDent/borgmatic
def test_make_exclude_flags_includes_exclude_patterns_filename_when_given():
    exclude_flags = module._make_exclude_flags(
        location_config={'exclude_patterns': ['*.pyc', '/var']},
        exclude_patterns_filename='/tmp/excludes',
    )

    assert exclude_flags == ('--exclude-from', '/tmp/excludes')
コード例 #2
0
ファイル: test_create.py プロジェクト: irrenhaus/borgmatic
def test_make_exclude_flags_includes_both_filenames_when_patterns_given_and_exclude_from_in_config():
    exclude_flags = module._make_exclude_flags(
        location_config={'exclude_from': ['excludes']},
        exclude_filename='/tmp/excludes',
    )

    assert exclude_flags == ('--exclude-from', 'excludes', '--exclude-from', '/tmp/excludes')
コード例 #3
0
def test_make_exclude_flags_considers_none_exclude_from_filenames_as_empty():
    flexmock(module).should_receive('_write_exclude_file').and_return(None)

    exclude_flags = module._make_exclude_flags(
        location_config={'exclude_from': None}, )

    assert exclude_flags == ()
コード例 #4
0
ファイル: test_create.py プロジェクト: vscoder/borgmatic
def test_make_exclude_flags_includes_exclude_from_filenames_when_in_config():

    exclude_flags = module._make_exclude_flags(
        location_config={'exclude_from': ['excludes', 'other']})

    assert exclude_flags == ('--exclude-from', 'excludes', '--exclude-from',
                             'other')
コード例 #5
0
def test_make_exclude_flags_includes_exclude_patterns_filename_when_given():
    exclude_flags = module._make_exclude_flags(
        location_config={'exclude_patterns': ['*.pyc', '/var']},
        exclude_patterns_filename='/tmp/excludes',
    )

    assert exclude_flags == ('--exclude-from', '/tmp/excludes')
コード例 #6
0
ファイル: test_create.py プロジェクト: DanielDent/borgmatic
def test_make_exclude_flags_includes_exclude_from_filenames_when_in_config():
    flexmock(module).should_receive('_write_exclude_file').and_return(None)

    exclude_flags = module._make_exclude_flags(
        location_config={'exclude_from': ['excludes', 'other']},
    )

    assert exclude_flags == ('--exclude-from', 'excludes', '--exclude-from', 'other')
コード例 #7
0
ファイル: test_create.py プロジェクト: DanielDent/borgmatic
def test_make_exclude_flags_considers_none_exclude_from_filenames_as_empty():
    flexmock(module).should_receive('_write_exclude_file').and_return(None)

    exclude_flags = module._make_exclude_flags(
        location_config={'exclude_from': None},
    )

    assert exclude_flags == ()
コード例 #8
0
def test_make_exclude_flags_includes_exclude_from_filenames_when_in_config():
    flexmock(module).should_receive('_write_exclude_file').and_return(None)

    exclude_flags = module._make_exclude_flags(
        location_config={'exclude_from': ['excludes', 'other']}, )

    assert exclude_flags == ('--exclude-from', 'excludes', '--exclude-from',
                             'other')
コード例 #9
0
ファイル: test_create.py プロジェクト: DanielDent/borgmatic
def test_make_exclude_flags_includes_both_filenames_when_patterns_given_and_exclude_from_in_config():
    flexmock(module).should_receive('_write_exclude_file').and_return(None)

    exclude_flags = module._make_exclude_flags(
        location_config={'exclude_from': ['excludes']},
        exclude_patterns_filename='/tmp/excludes',
    )

    assert exclude_flags == ('--exclude-from', 'excludes', '--exclude-from', '/tmp/excludes')
コード例 #10
0
def test_make_exclude_flags_includes_both_filenames_when_patterns_given_and_exclude_from_in_config(
):
    flexmock(module).should_receive('_write_exclude_file').and_return(None)

    exclude_flags = module._make_exclude_flags(
        location_config={'exclude_from': ['excludes']},
        exclude_patterns_filename='/tmp/excludes',
    )

    assert exclude_flags == ('--exclude-from', 'excludes', '--exclude-from',
                             '/tmp/excludes')
コード例 #11
0
ファイル: test_create.py プロジェクト: vscoder/borgmatic
def test_make_exclude_flags_is_empty_when_config_has_no_excludes():
    exclude_flags = module._make_exclude_flags(location_config={})

    assert exclude_flags == ()
コード例 #12
0
ファイル: test_create.py プロジェクト: vscoder/borgmatic
def test_make_exclude_flags_includes_exclude_if_present_when_in_config():
    exclude_flags = module._make_exclude_flags(
        location_config={'exclude_if_present': 'exclude_me'})

    assert exclude_flags == ('--exclude-if-present', 'exclude_me')
コード例 #13
0
ファイル: test_create.py プロジェクト: vscoder/borgmatic
def test_make_exclude_flags_does_not_include_exclude_caches_when_false_in_config(
):
    exclude_flags = module._make_exclude_flags(
        location_config={'exclude_caches': False})

    assert exclude_flags == ()
コード例 #14
0
ファイル: test_create.py プロジェクト: vscoder/borgmatic
def test_make_exclude_flags_includes_exclude_caches_when_true_in_config():
    exclude_flags = module._make_exclude_flags(
        location_config={'exclude_caches': True})

    assert exclude_flags == ('--exclude-caches', )
コード例 #15
0
ファイル: test_create.py プロジェクト: vscoder/borgmatic
def test_make_exclude_flags_considers_none_exclude_from_filenames_as_empty():
    exclude_flags = module._make_exclude_flags(
        location_config={'exclude_from': None})

    assert exclude_flags == ()
コード例 #16
0
ファイル: test_create.py プロジェクト: DanielDent/borgmatic
def test_make_exclude_flags_does_not_include_exclude_caches_when_false_in_config():
    exclude_flags = module._make_exclude_flags(
        location_config={'exclude_caches': False},
    )

    assert exclude_flags == ()
コード例 #17
0
ファイル: test_create.py プロジェクト: DanielDent/borgmatic
def test_make_exclude_flags_includes_exclude_if_present_when_in_config():
    exclude_flags = module._make_exclude_flags(
        location_config={'exclude_if_present': 'exclude_me'},
    )

    assert exclude_flags == ('--exclude-if-present', 'exclude_me')
コード例 #18
0
ファイル: test_create.py プロジェクト: DanielDent/borgmatic
def test_make_exclude_flags_includes_exclude_caches_when_true_in_config():
    exclude_flags = module._make_exclude_flags(
        location_config={'exclude_caches': True},
    )

    assert exclude_flags == ('--exclude-caches',)
コード例 #19
0
ファイル: test_create.py プロジェクト: DanielDent/borgmatic
def test_make_exclude_flags_is_empty_when_config_has_no_excludes():
    exclude_flags = module._make_exclude_flags(location_config={})

    assert exclude_flags == ()