Пример #1
0
def test_basic_ignore_dir(basic):
    """Test ignoring some directory (which appears twice)."""
    _, tmpdir = basic
    tree = FSTree.at_path(tmpdir, {tmpdir}, ignore('a/'))
    # Causes 'h' to go too since it's now empty
    assert tree == FSTree({
        'j': FSTree({
            'a': None,
        }),
    })
Пример #2
0
def test_basic_ignore_dir(basic):
    """Test ignoring some directory (which appears twice)."""
    _, tmpdir = basic
    tree = FSTree.at_path(tmpdir, {tmpdir}, ignore('a/'))
    # Causes 'h' to go too since it's now empty
    assert tree == FSTree({
        'j': FSTree({
            'a': None,
        }),
    })
Пример #3
0
def test_basic_ignore_top_level_dir(basic):
    """Test ignoring some directory at the top level only."""
    _, tmpdir = basic
    tree = FSTree.at_path(tmpdir, {tmpdir}, ignore('/a/'))
    assert tree == FSTree({
        'h': FSTree({'a': FSTree({
            'i': None,
        })}),
        'j': FSTree({
            'a': None,
        }),
    })
Пример #4
0
def test_basic_ignore_several(basic):
    """Test ignoring several names."""
    _, tmpdir = basic
    tree = FSTree.at_path(tmpdir, {tmpdir}, ignore('b', 'h', 'j'))
    assert tree == FSTree({
        'a': FSTree({
            'a': FSTree({
                'd': None,
                'e': None,
            }),
            'f': None,
        }),
    })
Пример #5
0
def test_basic_ignore_top_level_dir(basic):
    """Test ignoring some directory at the top level only."""
    _, tmpdir = basic
    tree = FSTree.at_path(tmpdir, {tmpdir}, ignore('/a/'))
    assert tree == FSTree({
        'h': FSTree({
            'a': FSTree({
                'i': None,
            })
        }),
        'j': FSTree({
            'a': None,
        }),
    })
Пример #6
0
def test_basic_ignore_several(basic):
    """Test ignoring several names."""
    _, tmpdir = basic
    tree = FSTree.at_path(tmpdir, {tmpdir}, ignore('b', 'h', 'j'))
    assert tree == FSTree({
        'a':
        FSTree({
            'a': FSTree({
                'd': None,
                'e': None,
            }),
            'f': None,
        }),
    })
Пример #7
0
def test_basic_ignore_file_and_dir(basic):
    """Test ignoring some name used for file and directory."""
    _, tmpdir = basic
    tree = FSTree.at_path(tmpdir, {tmpdir}, ignore('a'))
    # Everything disappears
    assert tree == FSTree({})
Пример #8
0
def test_basic_ignore_tree_being_walked(basic):
    """Test ignoring the whole tree we're walking."""
    _, tmpdir = basic
    tree = FSTree.at_path(os.path.join(tmpdir, 'h'), {tmpdir}, ignore('h'))
    # Everything disappears
    assert tree == FSTree({})
Пример #9
0
def test_basic_ignore_file_and_dir(basic):
    """Test ignoring some name used for file and directory."""
    _, tmpdir = basic
    tree = FSTree.at_path(tmpdir, {tmpdir}, ignore('a'))
    # Everything disappears
    assert tree == FSTree({})
Пример #10
0
def test_basic_ignore_tree_being_walked(basic):
    """Test ignoring the whole tree we're walking."""
    _, tmpdir = basic
    tree = FSTree.at_path(os.path.join(tmpdir, 'h'), {tmpdir}, ignore('h'))
    # Everything disappears
    assert tree == FSTree({})