Skip to content

Commit

Permalink
mark path case sensitive tests as xfail for win32
Browse files Browse the repository at this point in the history
  • Loading branch information
abn committed Apr 16, 2020
1 parent 1fac3b7 commit 5168c49
Showing 1 changed file with 20 additions and 7 deletions.
27 changes: 20 additions & 7 deletions tests/masonry/builders/test_builder.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,13 @@
# -*- coding: utf-8 -*-
import sys

from email.parser import Parser

import pytest

from poetry.core.factory import Factory
from poetry.core.masonry.builders.builder import Builder
from poetry.core.utils._compat import PY36
from poetry.core.utils._compat import Path


Expand All @@ -11,20 +16,24 @@ def test_builder_find_excluded_files(mocker):
p.return_value = []

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

assert builder.find_excluded_files() == {"my_package/sub_pkg1/extra_file.xml"}


@pytest.mark.xfail(
sys.platform == "win32" and not PY36,
reason="Windows is case insensitive for the most part",
)
def test_builder_find_case_sensitive_excluded_files(mocker):
p = mocker.patch("poetry.core.vcs.git.Git.get_ignored_files")
p.return_value = []

builder = Builder(
Factory().create_poetry(
Path(__file__).parent / "fixtures" / "case_sensitive_exclusions"
),
)
)

assert builder.find_excluded_files() == {
Expand All @@ -38,22 +47,26 @@ def test_builder_find_case_sensitive_excluded_files(mocker):
}


@pytest.mark.xfail(
sys.platform == "win32" and not PY36,
reason="Windows is case insensitive for the most part",
)
def test_builder_find_invalid_case_sensitive_excluded_files(mocker):
p = mocker.patch("poetry.core.vcs.git.Git.get_ignored_files")
p.return_value = []

builder = Builder(
Factory().create_poetry(
Path(__file__).parent / "fixtures" / "invalid_case_sensitive_exclusions"
),
)
)

assert {"my_package/Bar/foo/bar/Foo.py"} == builder.find_excluded_files()


def test_get_metadata_content():
builder = Builder(
Factory().create_poetry(Path(__file__).parent / "fixtures" / "complete"),
Factory().create_poetry(Path(__file__).parent / "fixtures" / "complete")
)

metadata = builder.get_metadata_content()
Expand Down Expand Up @@ -103,7 +116,7 @@ def test_get_metadata_content():

def test_metadata_homepage_default():
builder = Builder(
Factory().create_poetry(Path(__file__).parent / "fixtures" / "simple_version"),
Factory().create_poetry(Path(__file__).parent / "fixtures" / "simple_version")
)

metadata = Parser().parsestr(builder.get_metadata_content())
Expand All @@ -115,7 +128,7 @@ def test_metadata_with_vcs_dependencies():
builder = Builder(
Factory().create_poetry(
Path(__file__).parent / "fixtures" / "with_vcs_dependency"
),
)
)

metadata = Parser().parsestr(builder.get_metadata_content())
Expand All @@ -129,7 +142,7 @@ def test_metadata_with_url_dependencies():
builder = Builder(
Factory().create_poetry(
Path(__file__).parent / "fixtures" / "with_url_dependency"
),
)
)

metadata = Parser().parsestr(builder.get_metadata_content())
Expand Down

0 comments on commit 5168c49

Please sign in to comment.