Skip to content

Commit

Permalink
tests for unknown license
Browse files Browse the repository at this point in the history
  • Loading branch information
wimglenn committed Sep 25, 2020
1 parent c0c86b5 commit 5d10ad9
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 5 deletions.
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
version="1.6",
description="Display dependency tree of Python distribution",
long_description=open("README.md").read(),
long_description_content_type='text/markdown',
long_description_content_type="text/markdown",
packages=["johnnydep"],
author="Wim Glenn",
author_email="[email protected]",
Expand Down
13 changes: 9 additions & 4 deletions tests/test_lib.py
Original file line number Diff line number Diff line change
Expand Up @@ -481,7 +481,7 @@ def test_get_caching(make_dist, mocker):
]


def test_extras_parsing(make_dist, mocker):
def test_extras_parsing(make_dist):
make_dist(name="parent", install_requires=['child; extra == "foo" or extra == "bar"'])
make_dist(name="child")
assert JohnnyDist("parent").requires == []
Expand All @@ -491,11 +491,16 @@ def test_extras_parsing(make_dist, mocker):
assert JohnnyDist("parent[baz,foo]").requires == ["child"]


def test_license_parsing_metadaa(make_dist, mocker):
def test_license_parsing_metadaa(make_dist):
make_dist(license="The License")
assert JohnnyDist("jdtest").license == "The License"


def test_license_parsing_classifiers(make_dist, mocker):
make_dist(license="", classifiers=["License :: OSI Approved :: MIT License"])
def test_license_parsing_classifiers(make_dist):
make_dist(license="", classifiers=["blah", "License :: OSI Approved :: MIT License"])
assert JohnnyDist("jdtest").license == "MIT License"


def test_license_parsing_unknown(make_dist):
make_dist(license="")
assert JohnnyDist("jdtest").license == ""

0 comments on commit 5d10ad9

Please sign in to comment.