Skip to content

Commit a40ae7e

Browse files
committed
Add tests for sdist zip.
1 parent cb424e2 commit a40ae7e

File tree

1 file changed

+18
-0
lines changed

1 file changed

+18
-0
lines changed

metadata_please/tests/sdist.py

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -93,6 +93,24 @@ def test_basic_metadata_absl_py_09(self) -> None:
9393
)
9494
self.assertEqual({"test"}, bm.provides_extra)
9595

96+
def test_basic_metadata_fields(self) -> None:
97+
z = MemoryZipFile(
98+
{
99+
"foo/__init__.py": b"",
100+
"foo.egg-info/PKG-INFO": b"Requires-Dist: foo\nVersion: 1.2.58\nSummary: Some Summary\nHome-page: http://example.com\nAuthor: Chicken\nAuthor-email: [email protected]\nKeywords: farm,animals\nRequires-Python: >=3.6\nDescription-Content-Type: text/markdown",
101+
}
102+
)
103+
bm = basic_metadata_from_zip_sdist(z) # type: ignore
104+
self.assertEqual(["foo"], bm.reqs)
105+
self.assertEqual("1.2.58", bm.version)
106+
self.assertEqual("Some Summary", bm.summary)
107+
self.assertEqual("http://example.com", bm.url)
108+
self.assertEqual("Chicken", bm.author)
109+
self.assertEqual("[email protected]", bm.author_email)
110+
self.assertEqual("farm,animals", bm.keywords)
111+
self.assertEqual("text/markdown", bm.long_description_content_type)
112+
self.assertEqual(None, bm.description)
113+
96114

97115
class TarSdistTest(unittest.TestCase):
98116
def test_requires_as_expected(self) -> None:

0 commit comments

Comments
 (0)