Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
S
setuptools
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Jérome Perrin
setuptools
Commits
3db95bcc
Commit
3db95bcc
authored
Dec 29, 2018
by
Paul Ganssle
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add explicit test for license in setup.cfg
parent
4a8dedf0
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
20 additions
and
0 deletions
+20
-0
setuptools/tests/test_config.py
setuptools/tests/test_config.py
+20
-0
No files found.
setuptools/tests/test_config.py
View file @
3db95bcc
import
contextlib
import
pytest
from
distutils.errors
import
DistutilsOptionError
,
DistutilsFileError
from
mock
import
patch
from
setuptools.dist
import
Distribution
,
_Distribution
from
setuptools.config
import
ConfigHandler
,
read_configuration
from
.
import
py2_only
,
py3_only
from
.textwrap
import
DALS
class
ErrConfigHandler
(
ConfigHandler
):
"""Erroneous handler. Fails to implement required methods."""
...
...
@@ -146,6 +148,24 @@ class TestMetadata:
assert
metadata
.
download_url
==
'http://test.test.com/test/'
assert
metadata
.
maintainer_email
==
'test@test.com'
def
test_license_cfg
(
self
,
tmpdir
):
fake_env
(
tmpdir
,
DALS
(
"""
[metadata]
name=foo
version=0.0.1
license=Apache 2.0
"""
)
)
with
get_dist
(
tmpdir
)
as
dist
:
metadata
=
dist
.
metadata
assert
metadata
.
name
==
"foo"
assert
metadata
.
version
==
"0.0.1"
assert
metadata
.
license
==
"Apache 2.0"
def
test_file_mixed
(
self
,
tmpdir
):
fake_env
(
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment