diff options
| author | Jason R. Coombs <jaraco@jaraco.com> | 2017-09-03 13:33:20 -0400 |
|---|---|---|
| committer | Jason R. Coombs <jaraco@jaraco.com> | 2017-09-03 13:33:20 -0400 |
| commit | 45bc4b99137a4f7a627439239a193d89ff6cfee9 (patch) | |
| tree | a3a2650f355e0a26ef8b04aa41e93aa0de0d4737 /setuptools/tests | |
| parent | e5461b6ccc57596c7e9cf7837084f8a20eeec9b7 (diff) | |
| parent | 09e14c771f8dfd08122c63dc7bc1027d0040c26e (diff) | |
| download | external_python_setuptools-45bc4b99137a4f7a627439239a193d89ff6cfee9.tar.gz external_python_setuptools-45bc4b99137a4f7a627439239a193d89ff6cfee9.tar.bz2 external_python_setuptools-45bc4b99137a4f7a627439239a193d89ff6cfee9.zip | |
Merge branch 'master' into pr1127
Diffstat (limited to 'setuptools/tests')
| -rw-r--r-- | setuptools/tests/test_config.py | 18 | ||||
| -rw-r--r-- | setuptools/tests/test_egg_info.py | 25 |
2 files changed, 43 insertions, 0 deletions
diff --git a/setuptools/tests/test_config.py b/setuptools/tests/test_config.py index dbabd69e..cdfa5af4 100644 --- a/setuptools/tests/test_config.py +++ b/setuptools/tests/test_config.py @@ -139,6 +139,24 @@ class TestMetadata: assert metadata.download_url == 'http://test.test.com/test/' assert metadata.maintainer_email == 'test@test.com' + def test_file_mixed(self, tmpdir): + + fake_env( + tmpdir, + '[metadata]\n' + 'long_description = file: README.rst, CHANGES.rst\n' + '\n' + ) + + tmpdir.join('README.rst').write('readme contents\nline2') + tmpdir.join('CHANGES.rst').write('changelog contents\nand stuff') + + with get_dist(tmpdir) as dist: + assert dist.metadata.long_description == ( + 'readme contents\nline2\n' + 'changelog contents\nand stuff' + ) + def test_file_sandboxed(self, tmpdir): fake_env( diff --git a/setuptools/tests/test_egg_info.py b/setuptools/tests/test_egg_info.py index 33d6cc52..e454694d 100644 --- a/setuptools/tests/test_egg_info.py +++ b/setuptools/tests/test_egg_info.py @@ -398,6 +398,31 @@ class TestEggInfo(object): self._run_install_command(tmpdir_cwd, env) assert glob.glob(os.path.join(env.paths['lib'], 'barbazquux*')) == [] + def test_long_description_content_type(self, tmpdir_cwd, env): + # Test that specifying a `long_description_content_type` keyword arg to + # the `setup` function results in writing a `Description-Content-Type` + # line to the `PKG-INFO` file in the `<distribution>.egg-info` + # directory. + # `Description-Content-Type` is described at + # https://github.com/pypa/python-packaging-user-guide/pull/258 + + self._setup_script_with_requires( + """long_description_content_type='text/markdown',""") + environ = os.environ.copy().update( + HOME=env.paths['home'], + ) + code, data = environment.run_setup_py( + cmd=['egg_info'], + pypath=os.pathsep.join([env.paths['lib'], str(tmpdir_cwd)]), + data_stream=1, + env=environ, + ) + egg_info_dir = os.path.join('.', 'foo.egg-info') + with open(os.path.join(egg_info_dir, 'PKG-INFO')) as pkginfo_file: + pkg_info_lines = pkginfo_file.read().split('\n') + expected_line = 'Description-Content-Type: text/markdown' + assert expected_line in pkg_info_lines + def test_python_requires_egg_info(self, tmpdir_cwd, env): self._setup_script_with_requires( """python_requires='>=2.7.12',""") |
