Skip to content

Commit 3ba041d

Browse files
committed
Add test for #20 (add 'Provides' when 'extras' are used)
1 parent 9849517 commit 3ba041d

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

py2deb/tests.py

+8-2
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# Automated tests for the `py2deb' package.
22
#
33
# Author: Peter Odding <peter.odding@paylogic.com>
4-
# Last Change: July 31, 2020
4+
# Last Change: August 4, 2020
55
# URL: https://py2deb.readthedocs.io
66

77
"""
@@ -348,7 +348,13 @@ def test_conversion_of_extras(self):
348348
expression = '%s (= 3.6.0)' % fix_name_prefix('python-raven-flask')
349349
assert expression in relationships
350350
# Check that a package with the extra in the filename was generated.
351-
assert find_package_archive(archives, fix_name_prefix('python-raven-flask'))
351+
archive = find_package_archive(archives, fix_name_prefix('python-raven-flask'))
352+
assert archive
353+
# Use deb-pkg-tools to inspect the package metadata.
354+
metadata, contents = inspect_package(archive)
355+
logger.debug("Metadata of generated package: %s", dict(metadata))
356+
# Check that a "Provides" field was added.
357+
assert metadata['Provides'].matches(fix_name_prefix('python-raven'))
352358

353359
def test_conversion_of_environment_markers(self):
354360
"""

0 commit comments

Comments
 (0)