summaryrefslogtreecommitdiffstats
path: root/Lib/test/test_zlib.py
diff options
context:
space:
mode:
authorNadeem Vawda <nadeem.vawda@gmail.com>2011-09-11 22:04:13 (GMT)
committerNadeem Vawda <nadeem.vawda@gmail.com>2011-09-11 22:04:13 (GMT)
commit64d25ddb9c31b94aadfc8c9f220b0a5759e20265 (patch)
tree442b3e50e070948f246c58618d9d6d75c809cb56 /Lib/test/test_zlib.py
parent249ab5e8d1452ab7bc43b0f1e1221e0065d2e52d (diff)
downloadcpython-64d25ddb9c31b94aadfc8c9f220b0a5759e20265.zip
cpython-64d25ddb9c31b94aadfc8c9f220b0a5759e20265.tar.gz
cpython-64d25ddb9c31b94aadfc8c9f220b0a5759e20265.tar.bz2
Issue #12306: Add ZLIB_RUNTIME_VERSION to the zlib module.
While we're at it, also document ZLIB_VERSION. Patch by Torsten Landschoff.
Diffstat (limited to 'Lib/test/test_zlib.py')
-rw-r--r--Lib/test/test_zlib.py12
1 files changed, 12 insertions, 0 deletions
diff --git a/Lib/test/test_zlib.py b/Lib/test/test_zlib.py
index dddde47..8d137ac 100644
--- a/Lib/test/test_zlib.py
+++ b/Lib/test/test_zlib.py
@@ -13,6 +13,17 @@ except ImportError:
mmap = None
+class VersionTestCase(unittest.TestCase):
+
+ def test_library_version(self):
+ # On the build system, ZLIB_RUNTIME_VERSION should match ZLIB_VERSION.
+ # ZLIB_RUNTIME_VERSION is the actual library version while ZLIB_VERSION
+ # is the version from the header file. On the build system, the headers
+ # should match with the library exactly. At runtime, only the first
+ # digit is required to match.
+ self.assertEqual(zlib.ZLIB_RUNTIME_VERSION, zlib.ZLIB_VERSION)
+
+
class ChecksumTestCase(unittest.TestCase):
# checksum test cases
def test_crc32start(self):
@@ -647,6 +658,7 @@ LAERTES
def test_main():
support.run_unittest(
+ VersionTestCase,
ChecksumTestCase,
ChecksumBigBufferTestCase,
ExceptionTestCase,