Exemplo n.º 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,
        }),
    })
Exemplo n.º 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,
        }),
    })
Exemplo n.º 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,
        }),
    })
Exemplo n.º 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,
        }),
    })
Exemplo n.º 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,
        }),
    })
Exemplo n.º 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,
        }),
    })
Exemplo n.º 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({})
Exemplo n.º 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({})
Exemplo n.º 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({})
Exemplo n.º 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({})