예제 #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
예제 #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
예제 #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')]
예제 #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')]
예제 #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