aboutsummaryrefslogtreecommitdiffstats
path: root/setuptools
diff options
context:
space:
mode:
authorJason R. Coombs <jaraco@jaraco.com>2013-07-15 13:31:00 -0400
committerJason R. Coombs <jaraco@jaraco.com>2013-07-15 13:31:00 -0400
commit915f05b7445af2c51b63d22e429d9a7397221518 (patch)
tree9ff03ffcad38171cba39620cc0e68d98eed9f2d3 /setuptools
parentb34eec598da6d2668de58cba166f5ac5d063ba9d (diff)
downloadexternal_python_setuptools-915f05b7445af2c51b63d22e429d9a7397221518.tar.gz
external_python_setuptools-915f05b7445af2c51b63d22e429d9a7397221518.tar.bz2
external_python_setuptools-915f05b7445af2c51b63d22e429d9a7397221518.zip
Use 'is_valid' instead of simply 'valid' or 'check', which are less clear about the purpose of the method. Fixes AttributeError introduces in 0.9.2. Fixes #42.0.9.3
Diffstat (limited to 'setuptools')
-rwxr-xr-xsetuptools/package_index.py6
-rw-r--r--setuptools/tests/test_packageindex.py6
2 files changed, 6 insertions, 6 deletions
diff --git a/setuptools/package_index.py b/setuptools/package_index.py
index 4c4a647d..70aabd1b 100755
--- a/setuptools/package_index.py
+++ b/setuptools/package_index.py
@@ -202,7 +202,7 @@ class ContentChecker(object):
"""
return
- def check(self):
+ def is_valid(self):
"""
Check the hash. Return False if validation fails.
"""
@@ -239,7 +239,7 @@ class HashChecker(ContentChecker):
def feed(self, block):
self.hash.update(block)
- def check(self):
+ def is_valid(self):
return self.hash.hexdigest() == self.expected
def report(self, reporter, template):
@@ -445,7 +445,7 @@ class PackageIndex(Environment):
"""
checker.report(self.debug,
"Validating %%s checksum for %s" % filename)
- if not checker.valid():
+ if not checker.is_valid():
tfp.close()
os.unlink(filename)
raise DistutilsError(
diff --git a/setuptools/tests/test_packageindex.py b/setuptools/tests/test_packageindex.py
index d3698c9e..4f2d382c 100644
--- a/setuptools/tests/test_packageindex.py
+++ b/setuptools/tests/test_packageindex.py
@@ -151,18 +151,18 @@ class TestContentCheckers(unittest.TestCase):
checker.feed('You should probably not be using MD5'.encode('ascii'))
self.assertEqual(checker.hash.hexdigest(),
'f12895fdffbd45007040d2e44df98478')
- self.assertTrue(checker.check())
+ self.assertTrue(checker.is_valid())
def test_other_fragment(self):
"Content checks should succeed silently if no hash is present"
checker = setuptools.package_index.HashChecker.from_url(
'http://foo/bar#something%20completely%20different')
checker.feed('anything'.encode('ascii'))
- self.assertTrue(checker.check())
+ self.assertTrue(checker.is_valid())
def test_blank_md5(self):
"Content checks should succeed if a hash is empty"
checker = setuptools.package_index.HashChecker.from_url(
'http://foo/bar#md5=')
checker.feed('anything'.encode('ascii'))
- self.assertTrue(checker.check())
+ self.assertTrue(checker.is_valid())