diff options
| author | Marc Abramowitz <marc@marc-abramowitz.com> | 2016-07-31 15:17:12 -0700 |
|---|---|---|
| committer | Dustin Ingram <di@users.noreply.github.com> | 2017-08-28 12:32:11 -0500 |
| commit | ffc5f66bf730106854bd2bf41da494d5a17dcc46 (patch) | |
| tree | 61536670cbd28b6e0dc94efbcff85c1ffefb7711 /setuptools/tests/test_egg_info.py | |
| parent | 4fc60ed1e47f725a833dd63656ceec981a58e1a0 (diff) | |
| download | external_python_setuptools-ffc5f66bf730106854bd2bf41da494d5a17dcc46.tar.gz external_python_setuptools-ffc5f66bf730106854bd2bf41da494d5a17dcc46.tar.bz2 external_python_setuptools-ffc5f66bf730106854bd2bf41da494d5a17dcc46.zip | |
Add test_long_description_content_type
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
Diffstat (limited to 'setuptools/tests/test_egg_info.py')
| -rw-r--r-- | setuptools/tests/test_egg_info.py | 25 |
1 files changed, 25 insertions, 0 deletions
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',""") |
