Skip to content

Commit

Permalink
Remove hard-coded indexes of metadata lines. Ref #2641.
Browse files Browse the repository at this point in the history
  • Loading branch information
jaraco committed May 9, 2021
1 parent fb37758 commit b65f394
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions setuptools/tests/test_egg_info.py
Expand Up @@ -919,7 +919,7 @@ def test_license(self, tmpdir_cwd, env):
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')
assert 'License: MIT' == pkg_info_lines[7]
assert 'License: MIT' in pkg_info_lines

def test_license_escape(self, tmpdir_cwd, env):
"""Test license is escaped correctly if longer than one line."""
Expand All @@ -934,8 +934,10 @@ def test_license_escape(self, tmpdir_cwd, env):
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')
assert 'License: This is a long license text ' == pkg_info_lines[7]
assert ' over multiple lines' == pkg_info_lines[8]

assert 'License: This is a long license text ' in pkg_info_lines
assert ' over multiple lines' in pkg_info_lines
assert 'text \n over multiple' in '\n'.join(pkg_info_lines)

def test_python_requires_egg_info(self, tmpdir_cwd, env):
self._setup_script_with_requires(
Expand Down

0 comments on commit b65f394

Please sign in to comment.