Beispiel #1
0
def test_builder_find_excluded_files(mocker):
    p = mocker.patch("poetry.vcs.git.Git.get_ignored_files")
    p.return_value = []

    builder = Builder(
        Factory().create_poetry(Path(__file__).parent / "fixtures" / "complete"),
        NullEnv(),
        NullIO(),
    )

    assert builder.find_excluded_files() == {"my_package/sub_pkg1/extra_file.xml"}
Beispiel #2
0
def test_builder_find_invalid_case_sensitive_excluded_files(mocker):
    p = mocker.patch("poetry.vcs.git.Git.get_ignored_files")
    p.return_value = []

    builder = Builder(
        Poetry.create(
            Path(__file__).parent / "fixtures" /
            "invalid_case_sensitive_exclusions"),
        NullEnv(),
        NullIO(),
    )

    assert {"my_package/Bar/foo/bar/Foo.py"} == builder.find_excluded_files()
Beispiel #3
0
def test_builder_find_case_sensitive_excluded_files(mocker):
    p = mocker.patch("poetry.vcs.git.Git.get_ignored_files")
    p.return_value = []

    builder = Builder(
        Poetry.create(
            Path(__file__).parent / "fixtures" / "case_sensitive_exclusions"),
        NullEnv(),
        NullIO(),
    )

    assert builder.find_excluded_files() == {
        "my_package/FooBar/Bar.py",
        "my_package/FooBar/lowercasebar.py",
        "my_package/Foo/SecondBar.py",
        "my_package/Foo/Bar.py",
        "my_package/Foo/lowercasebar.py",
        "my_package/bar/foo.py",
        "my_package/bar/CapitalFoo.py",
    }