Ejemplo n.º 1
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')
Ejemplo n.º 2
0
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')
Ejemplo n.º 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 == ()
Ejemplo n.º 4
0
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')
Ejemplo n.º 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')
Ejemplo n.º 6
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')
Ejemplo n.º 7
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 == ()
Ejemplo n.º 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')
Ejemplo n.º 9
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')
Ejemplo n.º 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')
Ejemplo n.º 11
0
def test_make_exclude_flags_is_empty_when_config_has_no_excludes():
    exclude_flags = module._make_exclude_flags(location_config={})

    assert exclude_flags == ()
Ejemplo n.º 12
0
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')
Ejemplo n.º 13
0
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 == ()
Ejemplo n.º 14
0
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', )
Ejemplo n.º 15
0
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 == ()
Ejemplo n.º 16
0
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 == ()
Ejemplo n.º 17
0
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')
Ejemplo n.º 18
0
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',)
Ejemplo n.º 19
0
def test_make_exclude_flags_is_empty_when_config_has_no_excludes():
    exclude_flags = module._make_exclude_flags(location_config={})

    assert exclude_flags == ()