Skip to content

Commit

Permalink
Additional test cases
Browse files Browse the repository at this point in the history
  • Loading branch information
cdce8p committed Apr 3, 2021
1 parent 91e7956 commit 1da769c
Showing 1 changed file with 62 additions and 3 deletions.
65 changes: 62 additions & 3 deletions setuptools/tests/test_egg_info.py
Original file line number Diff line number Diff line change
Expand Up @@ -545,7 +545,15 @@ def test_doesnt_provides_extra(self, tmpdir_cwd, env):
"""),
'MANIFEST.in': "exclude LICENSE",
'LICENSE': "Test license"
}, False) # license file is manually excluded
}, False), # license file is manually excluded
pytest.param({
'setup.cfg': DALS("""
[metadata]
license_file = LICEN[CS]E*
"""),
'LICENSE': "Test license",
}, True,
id="glob_pattern"),
])
def test_setup_cfg_license_file(
self, tmpdir_cwd, env, files, license_in_sources):
Expand Down Expand Up @@ -644,7 +652,37 @@ def test_setup_cfg_license_file(
'MANIFEST.in': "exclude LICENSE-XYZ",
'LICENSE-ABC': "ABC license",
'LICENSE-XYZ': "XYZ license"
}, ['LICENSE-ABC'], ['LICENSE-XYZ']) # subset is manually excluded
}, ['LICENSE-ABC'], ['LICENSE-XYZ']), # subset is manually excluded
pytest.param({
'setup.cfg': DALS("""
"""),
'LICENSE-ABC': "ABC license",
'COPYING-ABC': "ABC copying",
'NOTICE-ABC': "ABC notice",
'AUTHORS-ABC': "ABC authors",
'LICENCE-XYZ': "XYZ license",
'LICENSE': "License",
'INVALID-LICENSE': "Invalid license",
}, [
'LICENSE-ABC',
'COPYING-ABC',
'NOTICE-ABC',
'AUTHORS-ABC',
'LICENCE-XYZ',
'LICENSE',
], ['INVALID-LICENSE'],
# ('LICEN[CS]E*', 'COPYING*', 'NOTICE*', 'AUTHORS*')
id="default_glob_patterns"),
pytest.param({
'setup.cfg': DALS("""
[metadata]
license_files =
LICENSE*
"""),
'LICENSE-ABC': "ABC license",
'NOTICE-XYZ': "XYZ notice",
}, ['LICENSE-ABC'], ['NOTICE-XYZ'],
id="no_default_glob_patterns"),
])
def test_setup_cfg_license_files(
self, tmpdir_cwd, env, files, incl_licenses, excl_licenses):
Expand Down Expand Up @@ -749,7 +787,28 @@ def test_setup_cfg_license_files(
'LICENSE-PQR': "PQR license",
'LICENSE-XYZ': "XYZ license"
# manually excluded
}, ['LICENSE-XYZ'], ['LICENSE-ABC', 'LICENSE-PQR'])
}, ['LICENSE-XYZ'], ['LICENSE-ABC', 'LICENSE-PQR']),
pytest.param({
'setup.cfg': DALS("""
[metadata]
license_file = LICENSE*
"""),
'LICENSE-ABC': "ABC license",
'NOTICE-XYZ': "XYZ notice",
}, ['LICENSE-ABC'], ['NOTICE-XYZ'],
id="no_default_glob_patterns"),
pytest.param({
'setup.cfg': DALS("""
[metadata]
license_file = LICENSE*
license_files =
NOTICE*
"""),
'LICENSE-ABC': "ABC license",
'NOTICE-ABC': "ABC notice",
'AUTHORS-ABC': "ABC authors",
}, ['LICENSE-ABC', 'NOTICE-ABC'], ['AUTHORS-ABC'],
id="combined_glob_patterrns"),
])
def test_setup_cfg_license_file_license_files(
self, tmpdir_cwd, env, files, incl_licenses, excl_licenses):
Expand Down

0 comments on commit 1da769c

Please sign in to comment.