-
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #3224 from pypa/feature/distutils-e1d5c9b1f6
Merge with distutils@e1d5c9b1f6
- Loading branch information
Showing
4 changed files
with
171 additions
and
108 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
Merge changes from pypa/distutils@e1d5c9b1f6 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -71,6 +71,28 @@ def test_check_metadata(self): | |
cmd = self._run(metadata) | ||
self.assertEqual(cmd._warnings, 0) | ||
|
||
def test_check_author_maintainer(self): | ||
for kind in ("author", "maintainer"): | ||
# ensure no warning when author_email or maintainer_email is given | ||
# (the spec allows these fields to take the form "Name <email>") | ||
metadata = {'url': 'xxx', | ||
kind + '_email': 'Name <[email protected]>', | ||
'name': 'xxx', 'version': 'xxx'} | ||
cmd = self._run(metadata) | ||
self.assertEqual(cmd._warnings, 0) | ||
|
||
# the check should warn if only email is given and it does not | ||
# contain the name | ||
metadata[kind + '_email'] = '[email protected]' | ||
cmd = self._run(metadata) | ||
self.assertEqual(cmd._warnings, 1) | ||
|
||
# the check should warn if only the name is given | ||
metadata[kind] = "Name" | ||
del metadata[kind + '_email'] | ||
cmd = self._run(metadata) | ||
self.assertEqual(cmd._warnings, 1) | ||
|
||
@unittest.skipUnless(HAS_DOCUTILS, "won't test without docutils") | ||
def test_check_document(self): | ||
pkg_info, dist = self.create_dist() | ||
|