Exemplo n.º 1
0
def test_word_expand_rec():
    word = Word([ConstantString("a/"), STARSTAR, ConstantString("/e")])
    env = make_env()

    with make_dirs("a/b*/cfood/e", "a/b*/cd/e/f") as d:
        with cwd(d):
            ans = expand(env, word, ".")

    assert ans == ["a/b*/cd/e", "a/b*/cfood/e"]
Exemplo n.º 2
0
def test_files_too():
    word = Word([STAR])
    env = make_env()

    with make_dirs("a", "b", ".c", ".d", TOUCH, "e", ".f") as d:
        with cwd(d):
            ans = expand(env, word, ".")

    assert ans == ["a", "b", "e"]
Exemplo n.º 3
0
def test_more_dots():
    word = Word([ConstantString("."), STAR])
    env = make_env()

    with make_dirs("a", "b", ".c", ".d", TOUCH, "e", ".f") as d:
        with cwd(d):
            ans = expand(env, word, ".")

    assert ans == [".c", ".d", ".f"]
Exemplo n.º 4
0
def test_no_dots():
    word = Word([STAR, ConstantString("/..")])
    env = make_env()

    with make_dirs("a", "b", ".c", ".d", TOUCH, "e", ".f") as d:
        with cwd(d):
            ans = expand(env, word, ".")

    assert ans == ["a/..", "b/.."]