diff options
author | Jason R. Coombs <jaraco@jaraco.com> | 2021-05-02 17:03:40 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-05-02 17:03:40 -0400 |
commit | 37e0c7850de902179b28f1378fbbc38a5ed3628c (patch) | |
tree | ecc352d5d7eaf99485bc4c2735d2a5f14f532084 /Lib/test/test_importlib/test_metadata_api.py | |
parent | 0ad1e0384c8afc5259a6d03363491d89500a5d03 (diff) | |
download | cpython-git-37e0c7850de902179b28f1378fbbc38a5ed3628c.tar.gz |
bpo-43926: Cleaner metadata with PEP 566 JSON support. (GH-25565)
* bpo-43926: Cleaner metadata with PEP 566 JSON support.
* Add blurb
* Add versionchanged and versionadded declarations for changes to metadata.
* Use descriptor for PEP 566
Diffstat (limited to 'Lib/test/test_importlib/test_metadata_api.py')
-rw-r--r-- | Lib/test/test_importlib/test_metadata_api.py | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/Lib/test/test_importlib/test_metadata_api.py b/Lib/test/test_importlib/test_metadata_api.py index 657c16603f..825edc10f1 100644 --- a/Lib/test/test_importlib/test_metadata_api.py +++ b/Lib/test/test_importlib/test_metadata_api.py @@ -231,6 +231,29 @@ class APITests( assert deps == expected + def test_as_json(self): + md = metadata('distinfo-pkg').json + assert 'name' in md + assert md['keywords'] == ['sample', 'package'] + desc = md['description'] + assert desc.startswith('Once upon a time\nThere was') + assert len(md['requires_dist']) == 2 + + def test_as_json_egg_info(self): + md = metadata('egginfo-pkg').json + assert 'name' in md + assert md['keywords'] == ['sample', 'package'] + desc = md['description'] + assert desc.startswith('Once upon a time\nThere was') + assert len(md['classifier']) == 2 + + def test_as_json_odd_case(self): + self.make_uppercase() + md = metadata('distinfo-pkg').json + assert 'name' in md + assert len(md['requires_dist']) == 2 + assert md['keywords'] == ['SAMPLE', 'PACKAGE'] + class LegacyDots(fixtures.DistInfoPkgWithDotLegacy, unittest.TestCase): def test_name_normalization(self): |