Skip to content

Commit

Permalink
make the metadata test pass on windows
Browse files Browse the repository at this point in the history
  • Loading branch information
cosmicexplorer committed Jun 16, 2020
1 parent 1dd0798 commit 7debab9
Showing 1 changed file with 20 additions and 14 deletions.
34 changes: 20 additions & 14 deletions tests/unit/shallow/test_wheel.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,23 +12,29 @@
context = Context()


def _strip_carriage_returns(s):
# type: (bytes) -> str
return s.decode().strip().replace('\r', '')


def test_extract_metadata_from_wheel():
name = ProjectName("asdf")
with serve_wheel(name, version="0.0.1") as url:
wheel_req = WheelMetadataRequest(url, project_name=name,)

metadata_contents = context.extract_wheel_metadata(wheel_req)
assert metadata_contents.contents.decode().strip() == dedent("""\
Metadata-Version: 2.1
Name: asdf
Version: 0.0.1
Summary: UNKNOWN
Home-page: UNKNOWN
Author: UNKNOWN
Author-email: UNKNOWN
License: UNKNOWN
Platform: UNKNOWN
Requires-Dist: requests
UNKNOWN
""").strip()
assert _strip_carriage_returns(metadata_contents.contents) == dedent(
"""\
Metadata-Version: 2.1
Name: asdf
Version: 0.0.1
Summary: UNKNOWN
Home-page: UNKNOWN
Author: UNKNOWN
Author-email: UNKNOWN
License: UNKNOWN
Platform: UNKNOWN
Requires-Dist: requests
UNKNOWN
""").strip()

0 comments on commit 7debab9

Please sign in to comment.