forked from pypa/setuptools
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add explicit test for license in setup.cfg
- Loading branch information
Showing
1 changed file
with
20 additions
and
0 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 |
---|---|---|
@@ -1,10 +1,12 @@ | ||
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 @@ def test_basic(self, tmpdir): | |
assert metadata.download_url == 'http://test.test.com/test/' | ||
assert metadata.maintainer_email == '[email protected]' | ||
|
||
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( | ||
|