Exemplo n.º 1
0
def test_skippy():
    files = """
        - a
        - b
        - f:
            - .dotfile
        - __pycache__:
            - c
        - htmlcov:
            - d
        - e.pyc
        - foo.egg-info:
            - e
    """
    with create_files(files) as root:
        assert {fname for _hex, fname in list_files(root, root)} == {'a', 'b'}

        assert {fname for _hex, fname in list_files(root, root, False)} == {'a', 'b'}

        assert [fname for _hex, fname in list_files(os.path.join(root, '.dotdir'), root)] == []
Exemplo n.º 2
0
def test_dot_path():
    files = """
        - a:
            - .skipfile: |
                b/.c/d/e
            - b:
                - .c:
                    - d:
                        - e: |
                            hello
                        - f: |
                            world
            - g
    """
    print "test_dot_path"
    with create_files(files) as directory:
        os.chdir(directory)
        assert [fname for _hex, fname in list_files('a', directory)] == ['g']