Exemplo n.º 1
0
def test_later_include_has_precedence():
    # note: this testcase is not exactly relevant any more since the tag
    # mechanism has been removed
    result = list(glob_files(ROOT_DIR, ['**', 'a/**']))
    assert (ROOT_DIR + '/b/ba.txt', 'b/ba.txt') in result
    assert (ROOT_DIR + '/b/bb.txt', 'b/bb.txt') in result
    assert (ROOT_DIR + '/a/aa.txt', 'a/aa.txt') in result
    assert (ROOT_DIR + '/a/ab.txt', 'a/ab.txt') in result
Exemplo n.º 2
0
def test_find_two_files():
    result = list(glob_files(ROOT_DIR, ['a/**']))
    #assert list(result) == [
    #    (ROOT_DIR + '/a/aa.txt', 'a/aa.txt'),
    #    (ROOT_DIR + '/a/ab.txt', 'a/ab.txt')
    #]
    assert (ROOT_DIR + '/a/aa.txt', 'a/aa.txt') in result
    assert (ROOT_DIR + '/a/ab.txt', 'a/ab.txt') in result
Exemplo n.º 3
0
def test_exclude_file_with_gitignore():
    result = glob_files(ROOT_DIR, ['a/**'], gitignore=['aa.txt'])
    assert list(result) == [(ROOT_DIR + '/a/ab.txt', 'a/ab.txt')]
Exemplo n.º 4
0
def test_exclude_file():
    result = glob_files(ROOT_DIR, ['a/**'], ['a/aa.txt'])
    assert list(result) == [(ROOT_DIR + '/a/ab.txt', 'a/ab.txt')]
Exemplo n.º 5
0
def test_default_include():
    result = list(glob_files(ROOT_DIR))
    assert (ROOT_DIR + '/a/aa.txt', 'a/aa.txt') in result
    assert (ROOT_DIR + '/a/ab.txt', 'a/ab.txt') in result
    assert (ROOT_DIR + '/b/ba.txt', 'b/ba.txt') in result
    assert (ROOT_DIR + '/b/bb.txt', 'b/bb.txt') in result