[Python-checkins] distutils2: Merge.
tarek.ziade
python-checkins at python.org
Sat Oct 2 00:52:19 CEST 2010
tarek.ziade pushed 10276d4979aa to distutils2:
http://hg.python.org/distutils2/rev/10276d4979aa
changeset: 707:10276d4979aa
parent: 706:daf17ae62195
parent: 705:6c3bcf1c4499
user: Rajiv Abraham <rajiv.abraham at gmail.com>
date: Wed Sep 29 22:44:37 2010 -0400
summary: Merge.
files:
diff --git a/distutils2/tests/test_index_simple.py b/distutils2/tests/test_index_simple.py
--- a/distutils2/tests/test_index_simple.py
+++ b/distutils2/tests/test_index_simple.py
@@ -20,7 +20,7 @@
urls
"""
if hosts is None:
- hosts = (server.full_address.strip("http://"),)
+ hosts = (server.full_address.replace("http://", ""),)
kwargs['hosts'] = hosts
return Crawler(server.full_address + base_url, *args,
**kwargs)
diff --git a/distutils2/tests/test_version.py b/distutils2/tests/test_version.py
--- a/distutils2/tests/test_version.py
+++ b/distutils2/tests/test_version.py
@@ -31,6 +31,17 @@
for v, s in self.versions:
self.assertEqual(str(v), s)
+ def test_hash(self):
+
+ for v, s in self.versions:
+ self.assertEqual(hash(v), hash(V(s)))
+
+ versions = set([v for v,s in self.versions])
+ for v, s in self.versions:
+ self.assertIn(v, versions)
+
+ self.assertEqual(set([V('1.0')]), set([V('1.0'), V('1.0')]))
+
def test_from_parts(self):
for v, s in self.versions:
@@ -188,6 +199,10 @@
# XXX need to silent the micro version in this case
#assert not VersionPredicate('Ho (<3.0,!=2.6)').match('2.6.3')
+ # test repr
+ for predicate in predicates:
+ self.assertEqual(str(VersionPredicate(predicate)), predicate)
+
def test_predicate_name(self):
# Test that names are parsed the right way
diff --git a/distutils2/version.py b/distutils2/version.py
--- a/distutils2/version.py
+++ b/distutils2/version.py
@@ -131,7 +131,7 @@
pad_zeros_length=0):
"""Parse 'N.N.N' sequences, return a list of ints.
- @param s {str} 'N.N.N..." sequence to be parsed
+ @param s {str} 'N.N.N...' sequence to be parsed
@param full_ver_str {str} The full version string from which this
comes. Used for error strings.
@param drop_trailing_zeros {bool} Whether to drop trailing zeros
@@ -206,7 +206,8 @@
return self.__eq__(other) or self.__gt__(other)
# See http://docs.python.org/reference/datamodel#object.__hash__
- __hash__ = object.__hash__
+ def __hash__(self):
+ return hash(self.parts)
def suggest_normalized_version(s):
--
Repository URL: http://hg.python.org/distutils2
More information about the Python-checkins
mailing list