Exemple #1
0
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)
Exemple #2
0
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
Exemple #3
0
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
Exemple #4
0
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
Exemple #5
0
def run_without_parameters(temp_dir):
    print("# ===== fsscan.run without parameters =====")
    for entry in fsscan.run(temp_dir):
        print(entry)