def test_scan_tree(tree): expected_data = [ files.DirData(tree, ["root0"], ["subdir"], ["test.feature"]), files.DirData(tree / "subdir", ["root0", "subdir"], [], ["another_test.feature"]), ] assert files.scan_tree(tree, False, []) == expected_data
def test_scan_tree_exclude(tree): expected_data = [ files.DirData(tree, ["root0"], ["_private_dir", "subdir"], ["test.feature"]), files.DirData(tree / "_private_dir", ["root0", "_private_dir"], [], []), ] assert files.scan_tree(tree, True, ["*subdir*"]) == expected_data
def test_scan_tree_relative(): relative_path = pathlib.Path("tests") expected_data = [ files.DirData( relative_path.resolve(), ["tests"], [], [ "README.rst", "basic.feature", "basic_pytest.feature", "nobackground_pytest.feature", "tags.feature", "tags_pytest.feature", ], ) ] assert files.scan_tree(relative_path, False, []) == expected_data