aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJason R. Coombs <jaraco@jaraco.com>2013-07-15 12:19:12 -0400
committerJason R. Coombs <jaraco@jaraco.com>2013-07-15 12:19:12 -0400
commitfdb212207c256eea656a21742aad8fba56a29bab (patch)
treecc9068b692788ed80e9a646f086064301b35b1ee
parent95bf90f3dae23f3d672450d94adfbcc55f9e252a (diff)
downloadexternal_python_setuptools-fdb212207c256eea656a21742aad8fba56a29bab.tar.gz
external_python_setuptools-fdb212207c256eea656a21742aad8fba56a29bab.tar.bz2
external_python_setuptools-fdb212207c256eea656a21742aad8fba56a29bab.zip
Added a test to prove the basic usage of content checks
-rw-r--r--setuptools/tests/test_packageindex.py11
1 files changed, 11 insertions, 0 deletions
diff --git a/setuptools/tests/test_packageindex.py b/setuptools/tests/test_packageindex.py
index 92d1e2e0..4fceee39 100644
--- a/setuptools/tests/test_packageindex.py
+++ b/setuptools/tests/test_packageindex.py
@@ -141,3 +141,14 @@ class TestPackageIndex(unittest.TestCase):
'reportlab-2.5.win-amd64-py2.7.exe'), ('reportlab-2.5', '2.7', 'win-amd64'))
self.assertEqual(setuptools.package_index.parse_bdist_wininst(
'reportlab-2.5.win-amd64.exe'), ('reportlab-2.5', None, 'win-amd64'))
+
+class TestContentCheckers(unittest.TestCase):
+
+ def test_md5(self):
+ checker = setuptools.package_index.HashChecker.from_url(
+ 'http://foo/bar#md5=f12895fdffbd45007040d2e44df98478')
+ self.assertEqual(checker.hash.name, 'md5')
+ checker.feed('You should probably not be using MD5'.encode('ascii'))
+ self.assertEqual(checker.hash.hexdigest(),
+ 'f12895fdffbd45007040d2e44df98478')
+ self.assertTrue(checker.check())