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, }), })
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, }), })
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, }), })
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, }), })
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({})
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({})