def run_with_parameters(temp_dir): print("# ===== fsscan.run with parameters =====") parameters = { "patterns": "*LOG*", "ignore_case": True, "wanted_type": fsscan.DIR_TYPE, "recursive": True, } for entry in fsscan.run(temp_dir, **parameters): print(entry)
def test_run_without_parameters(temp_dir): results = fsscan.run(temp_dir) expected = [ temp_dir + "/dir1", temp_dir + "/dir2", temp_dir + "/file1.py", ] results = sorted(results) expected = sorted(results) assert results == expected
def test_callback_cast_to_Path_to_str(temp_dir): parameters = { "patterns": "*.py", "recursive": True, } results = fsscan.run(temp_dir, **parameters) expected = [ temp_dir + "/dir1/file11.py", temp_dir + "/dir2/file21.py", temp_dir + "/dir2/file22.py", temp_dir + "/file1.py", ] results = sorted(fsscan.cast_to_Path_str(results)) expected = sorted(fsscan.cast_to_Path_str(expected)) assert results == expected
def test_run_with_parameters(temp_dir): parameters = { "patterns": "*LOG*", "ignore_case": True, "wanted_type": fsscan.DIR_TYPE, "recursive": True, } results = fsscan.run(temp_dir, **parameters) expected = [ temp_dir + "/dir1/logs", temp_dir + "/dir2/logs", ] results = sorted(results) expected = sorted(results) assert results == expected
def run_without_parameters(temp_dir): print("# ===== fsscan.run without parameters =====") for entry in fsscan.run(temp_dir): print(entry)