[Python-modules-commits] r1513 - in
/packages/ipy/branches/upstream/current: AUTHORS COPYING
ChangeLog IPy.egg-info/PKG-INFO IPy.egg-info/SOURCES.txt IPy.py Makefile
PKG-INFO README setup.py test/test_IPy.py test_doc.py
werner at users.alioth.debian.org
werner at users.alioth.debian.org
Sun Nov 19 17:01:10 CET 2006
Author: werner
Date: Sun Nov 19 17:01:10 2006
New Revision: 1513
URL: http://svn.debian.org/wsvn/python-modules/?sc=1&rev=1513
Log:
Load /tmp/tmp.PwNWm14193/ipy-0.52 into
packages/ipy/branches/upstream/current.
Added:
packages/ipy/branches/upstream/current/COPYING
packages/ipy/branches/upstream/current/test_doc.py (with props)
Modified:
packages/ipy/branches/upstream/current/AUTHORS
packages/ipy/branches/upstream/current/ChangeLog
packages/ipy/branches/upstream/current/IPy.egg-info/PKG-INFO
packages/ipy/branches/upstream/current/IPy.egg-info/SOURCES.txt
packages/ipy/branches/upstream/current/IPy.py
packages/ipy/branches/upstream/current/Makefile
packages/ipy/branches/upstream/current/PKG-INFO
packages/ipy/branches/upstream/current/README
packages/ipy/branches/upstream/current/setup.py
packages/ipy/branches/upstream/current/test/test_IPy.py
Modified: packages/ipy/branches/upstream/current/AUTHORS
URL: http://svn.debian.org/wsvn/python-modules/packages/ipy/branches/upstream/current/AUTHORS?rev=1513&op=diff
==============================================================================
--- packages/ipy/branches/upstream/current/AUTHORS (original)
+++ packages/ipy/branches/upstream/current/AUTHORS Sun Nov 19 17:01:10 2006
@@ -1,9 +1,9 @@
-Teenage mutant ninja hero c0ders <drt at un.bewaff.net> - IPy author(s?)
-
Jean Gillaux <jgillaux AT inl.fr> - Fix netmask "/0.0.0.0"
-Victor Stinner <victor.stinner AT inl.fr> - Patch setup.py for setuptools
+Victor Stinner <victor.stinner AT inl.fr> - Patch setup.py for setuptools, maintainer since version 0.5
+Mark Johnston - bringing IPy to Python 2.3
+Matthew Flanagan <mattimustang AT gmail.com> - Fix strCompressed()
+Maximillian Dornseif <md AT hudora.de> - IPy author and maintainer until version 0.42
+Samuel Krempp - fix __cmp__() bug
+Shell, Hin-lik Hung - bring IPy to OpenBSD ports
+Skinny Puppy - __add__() now always returns a value
William McVey <wam AT cisco.com> - Fix IP.__nonzero__()
-Mark Johnston - bringing IPy to Python 2.3
-Shell, Hin-lik Hung - bring IPy to OpenBSD ports
-Samuel Krempp - fix __cmp__() bug
-Skinny Puppy - __add__() now always returns a value
Added: packages/ipy/branches/upstream/current/COPYING
URL: http://svn.debian.org/wsvn/python-modules/packages/ipy/branches/upstream/current/COPYING?rev=1513&op=file
==============================================================================
--- packages/ipy/branches/upstream/current/COPYING (added)
+++ packages/ipy/branches/upstream/current/COPYING Sun Nov 19 17:01:10 2006
@@ -1,0 +1,26 @@
+Copyright (c) 2006, INL
+Copyright (c) 2001-2005, Maximillian Dornseif
+All rights reserved.
+Redistribution and use in source and binary forms, with or without
+modification, are permitted provided that the following conditions are met:
+
+ * Redistributions of source code must retain the above copyright
+ notice, this list of conditions and the following disclaimer.
+ * Redistributions in binary form must reproduce the above copyright
+ notice, this list of conditions and the following disclaimer in the
+ documentation and/or other materials provided with the distribution.
+ * Neither the name of IPy nor the names of its contributors may be used
+ to endorse or promote products derived from this software without
+ specific prior written permission.
+
+THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND ANY
+EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+DISCLAIMED. IN NO EVENT SHALL THE REGENTS AND CONTRIBUTORS BE LIABLE FOR ANY
+DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
Modified: packages/ipy/branches/upstream/current/ChangeLog
URL: http://svn.debian.org/wsvn/python-modules/packages/ipy/branches/upstream/current/ChangeLog?rev=1513&op=diff
==============================================================================
--- packages/ipy/branches/upstream/current/ChangeLog (original)
+++ packages/ipy/branches/upstream/current/ChangeLog Sun Nov 19 17:01:10 2006
@@ -1,3 +1,12 @@
+2006-11-02
+ * Release IPy 0.51
+ * Write real name of IPy author (Maximillian Dornseif)
+ * Use version "0.51" to help packaging since 0.5 was smaller than 0.42
+ * Fix unit test for Python 2.3 (don't use doctest.testfile) and 2.5
+ (problem of hex() lower case)
+ * "make test" also check IPy documentation
+ * IPy now works on Python 2.2 to 2.5
+
2006-10-26
* Release IPy 0.5
* Apply Jean Gillaux patch for netmask "/0.0.0.0" bug
Modified: packages/ipy/branches/upstream/current/IPy.egg-info/PKG-INFO
URL: http://svn.debian.org/wsvn/python-modules/packages/ipy/branches/upstream/current/IPy.egg-info/PKG-INFO?rev=1513&op=diff
==============================================================================
--- packages/ipy/branches/upstream/current/IPy.egg-info/PKG-INFO (original)
+++ packages/ipy/branches/upstream/current/IPy.egg-info/PKG-INFO Sun Nov 19 17:01:10 2006
@@ -1,7 +1,7 @@
Metadata-Version: 1.0
Name: IPy
-Version: 0.5
-Summary: IPv4 and IPv6 parsing and handling class
+Version: 0.52
+Summary: Class and tools for handling of IPv4 and IPv6 addresses and networks
Home-page: http://software.inl.fr/trac/trac.cgi/wiki/IPy
Author: Victor Stinner
Author-email: victor.stinner AT inl.fr
@@ -89,15 +89,16 @@
By default, IPy rejects uncommon netmask like 172.30.1.0/22:
+ >>> import IPy
+ >>> IPy.check_addr_prefixlen = True # default value
>>> ips = IP('172.30.1.0/22')
Traceback (most recent call last):
...
- ValueError: 0xAC1E0100L goes not well with prefixlen 22
+ ValueError: IP('172.30.1.0/22') has invalid prefix length (22)
You can change this behaviour with global option check_addr_prefixlen:
- >>> import IPy
- >>> IPy.check_addr_prefixlen = False
+ >>> IPy.check_addr_prefixlen = False # disable
>>> ips = IP('172.30.1.0/22')
>>> len(ips)
1024
@@ -149,6 +150,18 @@
What's new?
===========
+ Changes between version 0.51 and 0.52:
+
+ * Fix strCompressed() for IPv6 "ffff:ffff:ffff:ffff:ffff:f:f:fffc/127"
+
+ Changes between version 0.5 and 0.51:
+
+ * Use real name of IPy author
+ * Use version "0.51" to help packaging since 0.5 was smaller than 0.42
+ * Fix unit test for Python 2.3 (don't use doctest.testfile)
+ * Fix unit test for Python 2.5 (problem of hex() lower case)
+ * IPy now works on Python 2.2 to 2.5
+
Changes between version 0.42 and 0.5: Fix all known bugs:
* Apply Jean Gillaux's patch for netmask "/0.0.0.0" bug
@@ -165,7 +178,9 @@
Compatibility and links
=======================
- IPy should work on Python version 2.1 to 2.5.
+ IPy works on Python version 2.2 to 2.5.
+
+ This Python module is under BSD license: see COPYING file.
Further Information might be available at: http://software.inl.fr/trac/trac.cgi/wiki/IPy
Modified: packages/ipy/branches/upstream/current/IPy.egg-info/SOURCES.txt
URL: http://svn.debian.org/wsvn/python-modules/packages/ipy/branches/upstream/current/IPy.egg-info/SOURCES.txt?rev=1513&op=diff
==============================================================================
--- packages/ipy/branches/upstream/current/IPy.egg-info/SOURCES.txt (original)
+++ packages/ipy/branches/upstream/current/IPy.egg-info/SOURCES.txt Sun Nov 19 17:01:10 2006
@@ -1,10 +1,12 @@
AUTHORS
+COPYING
ChangeLog
IPy.py
Makefile
README
rest.css
setup.py
+test_doc.py
IPy.egg-info/PKG-INFO
IPy.egg-info/SOURCES.txt
IPy.egg-info/top_level.txt
Modified: packages/ipy/branches/upstream/current/IPy.py
URL: http://svn.debian.org/wsvn/python-modules/packages/ipy/branches/upstream/current/IPy.py?rev=1513&op=diff
==============================================================================
--- packages/ipy/branches/upstream/current/IPy.py (original)
+++ packages/ipy/branches/upstream/current/IPy.py Sun Nov 19 17:01:10 2006
@@ -80,15 +80,16 @@
By default, IPy rejects uncommon netmask like 172.30.1.0/22:
+ >>> import IPy
+ >>> IPy.check_addr_prefixlen = True # default value
>>> ips = IP('172.30.1.0/22')
Traceback (most recent call last):
...
- ValueError: 0xAC1E0100L goes not well with prefixlen 22
+ ValueError: IP('172.30.1.0/22') has invalid prefix length (22)
You can change this behaviour with global option check_addr_prefixlen:
- >>> import IPy
- >>> IPy.check_addr_prefixlen = False
+ >>> IPy.check_addr_prefixlen = False # disable
>>> ips = IP('172.30.1.0/22')
>>> len(ips)
1024
@@ -140,6 +141,18 @@
What's new?
===========
+Changes between version 0.51 and 0.52:
+
+ * Fix strCompressed() for IPv6 "ffff:ffff:ffff:ffff:ffff:f:f:fffc/127"
+
+Changes between version 0.5 and 0.51:
+
+ * Use real name of IPy author
+ * Use version "0.51" to help packaging since 0.5 was smaller than 0.42
+ * Fix unit test for Python 2.3 (don't use doctest.testfile)
+ * Fix unit test for Python 2.5 (problem of hex() lower case)
+ * IPy now works on Python 2.2 to 2.5
+
Changes between version 0.42 and 0.5: Fix all known bugs:
* Apply Jean Gillaux's patch for netmask "/0.0.0.0" bug
@@ -156,7 +169,9 @@
Compatibility and links
=======================
-IPy should work on Python version 2.1 to 2.5.
+IPy works on Python version 2.2 to 2.5.
+
+This Python module is under BSD license: see COPYING file.
Further Information might be available at: http://software.inl.fr/trac/trac.cgi/wiki/IPy
@@ -186,11 +201,11 @@
* refactor
"""
-# $HeadURL: https://svn.inl.fr/inl-svn/src/tools/ipy/trunk/IPy.py $
-# $Id: IPy.py 5217 2006-10-26 16:14:32Z haypo $
-
-__rcsid__ = '$Id: IPy.py 5217 2006-10-26 16:14:32Z haypo $'
-__version__ = '0.5'
+# $HeadURL: https://svn.inl.fr/inl-svn/src/tools/ipy/tags/IPy-0.52/IPy.py $
+# $Id: IPy.py 5420 2006-11-06 09:27:13Z haypo $
+
+__rcsid__ = '$Id: IPy.py 5420 2006-11-06 09:27:13Z haypo $'
+__version__ = '0.52'
import types
@@ -366,7 +381,7 @@
self._prefixlen = int(prefixlen)
if not _checkNetaddrWorksWithPrefixlen(self.ip, self._prefixlen, self._ipversion):
- raise ValueError, "%s goes not well with prefixlen %d" % (hex(self.ip), self._prefixlen)
+ raise ValueError, "%s has invalid prefix length (%s)" % (repr(self), self._prefixlen)
def int(self):
@@ -374,8 +389,8 @@
The same as IP[0].
- >>> hex(IP('10.0.0.0/8').int())
- '0xA000000L'
+ >>> "%X" % IP('10.0.0.0/8').int()
+ 'A000000'
"""
return self.ip
@@ -473,10 +488,12 @@
def strCompressed(self, wantprefixlen = None):
"""Return a string representation in compressed format using '::' Notation.
- >>> print IP('127.0.0.1').strCompressed()
- 127.0.0.1
- >>> print IP('2001:0658:022a:cafe:0200::1').strCompressed()
- 2001:658:22a:cafe:200::1
+ >>> IP('127.0.0.1').strCompressed()
+ '127.0.0.1'
+ >>> IP('2001:0658:022a:cafe:0200::1').strCompressed()
+ '2001:658:22a:cafe:200::1'
+ >>> IP('ffff:ffff:ffff:ffff:ffff:f:f:fffc/127').strCompressed()
+ 'ffff:ffff:ffff:ffff:ffff:f:f:fffc/127'
"""
if self.WantPrefixLen == None and wantprefixlen == None:
@@ -507,7 +524,7 @@
hextets = [''] + hextets
return ':'.join(hextets) + self._printPrefix(wantprefixlen)
else:
- return self.strNormal() + self._printPrefix(wantprefixlen)
+ return self.strNormal(0) + self._printPrefix(wantprefixlen)
def strNormal(self, wantprefixlen = None):
"""Return a string representation in the usual format.
@@ -547,12 +564,12 @@
return intToIp(self.ip, self._ipversion).lower() + self._printPrefix(wantprefixlen)
def strHex(self, wantprefixlen = None):
- """Return a string representation in hex format.
-
- >>> print IP('127.0.0.1').strHex()
- 0x7F000001
- >>> print IP('2001:0658:022a:cafe:0200::1').strHex()
- 0x20010658022ACAFE0200000000000001
+ """Return a string representation in hex format in lower case.
+
+ >>> IP('127.0.0.1').strHex()
+ '0x7f000001'
+ >>> IP('2001:0658:022a:cafe:0200::1').strHex()
+ '0x20010658022acafe0200000000000001'
"""
if self.WantPrefixLen == None and wantprefixlen == None:
@@ -561,7 +578,7 @@
x = hex(self.ip)
if x[-1] == 'L':
x = x[:-1]
- return x + self._printPrefix(wantprefixlen)
+ return x.lower() + self._printPrefix(wantprefixlen)
def strDec(self, wantprefixlen = None):
"""Return a string representation in decimal format.
@@ -616,8 +633,8 @@
def netmask(self):
"""Return netmask as an integer.
- >>> print hex(IP('195.185.0.0/16').netmask().int())
- 0xFFFF0000L
+ >>> "%X" % IP('195.185.0.0/16').netmask().int()
+ 'FFFF0000'
"""
# TODO: unify with prefixlenToNetmask?
@@ -695,16 +712,16 @@
>>> ip=IP('127.0.0.0/30')
>>> for x in ip:
- ... print hex(x.int())
+ ... print repr(x)
...
- 0x7F000000L
- 0x7F000001L
- 0x7F000002L
- 0x7F000003L
- >>> hex(ip[2].int())
- '0x7F000002L'
- >>> hex(ip[-1].int())
- '0x7F000003L'
+ IP('127.0.0.0')
+ IP('127.0.0.1')
+ IP('127.0.0.2')
+ IP('127.0.0.3')
+ >>> ip[2]
+ IP('127.0.0.2')
+ >>> ip[-1]
+ IP('127.0.0.3')
"""
if type(key) != types.IntType and type(key) != types.LongType:
@@ -724,8 +741,8 @@
Should return true if item is in self, false otherwise. Item
can be other IP-objects, strings or ints.
- >>> print IP('195.185.1.1').strHex()
- 0xC3B90101
+ >>> IP('195.185.1.1').strHex()
+ '0xc3b90101'
>>> 0xC3B90101L in IP('195.185.1.0/24')
1
>>> '127.0.0.1' in IP('127.0.0.0/24')
@@ -849,8 +866,8 @@
required property is that objects which compare equal have the
same hash value
- >>> hex(IP('10.0.0.0/24').__hash__())
- '0xf5ffffe7'
+ >>> IP('10.0.0.0/24').__hash__()
+ -167772185
"""
thehash = int(-1)
Modified: packages/ipy/branches/upstream/current/Makefile
URL: http://svn.debian.org/wsvn/python-modules/packages/ipy/branches/upstream/current/Makefile?rev=1513&op=diff
==============================================================================
--- packages/ipy/branches/upstream/current/Makefile (original)
+++ packages/ipy/branches/upstream/current/Makefile Sun Nov 19 17:01:10 2006
@@ -1,21 +1,25 @@
.PHONY: test
+PYTHON=python
test: README
@echo "[ run unit tests ]"
- python test/test_IPy.py || exit $$?
+ PYTHONPATH=$(PWD) $(PYTHON) test/test_IPy.py || exit $$?
@echo
@echo "[ test README ]"
- python -c "import doctest; doctest.testfile('README', optionflags=doctest.ELLIPSIS)" || exit $$?
+ $(PYTHON) test_doc.py || exit $$?
egg: clean README
- python setup.py sdist bdist_egg
+ $(PYTHON) setup.py sdist bdist_egg
README: IPy.py
- python -c "import IPy; open('README', 'w').write(IPy.__doc__)"
+ $(PYTHON) -c "import IPy; open('README', 'w').write(IPy.__doc__)"
IPy.html: README
rst2html README $@ --stylesheet=rest.css
+install:
+ ./setup.py install
+
clean:
rm -rf README IPy.html *.pyc build dist IPy.egg-info
Modified: packages/ipy/branches/upstream/current/PKG-INFO
URL: http://svn.debian.org/wsvn/python-modules/packages/ipy/branches/upstream/current/PKG-INFO?rev=1513&op=diff
==============================================================================
--- packages/ipy/branches/upstream/current/PKG-INFO (original)
+++ packages/ipy/branches/upstream/current/PKG-INFO Sun Nov 19 17:01:10 2006
@@ -1,7 +1,7 @@
Metadata-Version: 1.0
Name: IPy
-Version: 0.5
-Summary: IPv4 and IPv6 parsing and handling class
+Version: 0.52
+Summary: Class and tools for handling of IPv4 and IPv6 addresses and networks
Home-page: http://software.inl.fr/trac/trac.cgi/wiki/IPy
Author: Victor Stinner
Author-email: victor.stinner AT inl.fr
@@ -89,15 +89,16 @@
By default, IPy rejects uncommon netmask like 172.30.1.0/22:
+ >>> import IPy
+ >>> IPy.check_addr_prefixlen = True # default value
>>> ips = IP('172.30.1.0/22')
Traceback (most recent call last):
...
- ValueError: 0xAC1E0100L goes not well with prefixlen 22
+ ValueError: IP('172.30.1.0/22') has invalid prefix length (22)
You can change this behaviour with global option check_addr_prefixlen:
- >>> import IPy
- >>> IPy.check_addr_prefixlen = False
+ >>> IPy.check_addr_prefixlen = False # disable
>>> ips = IP('172.30.1.0/22')
>>> len(ips)
1024
@@ -149,6 +150,18 @@
What's new?
===========
+ Changes between version 0.51 and 0.52:
+
+ * Fix strCompressed() for IPv6 "ffff:ffff:ffff:ffff:ffff:f:f:fffc/127"
+
+ Changes between version 0.5 and 0.51:
+
+ * Use real name of IPy author
+ * Use version "0.51" to help packaging since 0.5 was smaller than 0.42
+ * Fix unit test for Python 2.3 (don't use doctest.testfile)
+ * Fix unit test for Python 2.5 (problem of hex() lower case)
+ * IPy now works on Python 2.2 to 2.5
+
Changes between version 0.42 and 0.5: Fix all known bugs:
* Apply Jean Gillaux's patch for netmask "/0.0.0.0" bug
@@ -165,7 +178,9 @@
Compatibility and links
=======================
- IPy should work on Python version 2.1 to 2.5.
+ IPy works on Python version 2.2 to 2.5.
+
+ This Python module is under BSD license: see COPYING file.
Further Information might be available at: http://software.inl.fr/trac/trac.cgi/wiki/IPy
Modified: packages/ipy/branches/upstream/current/README
URL: http://svn.debian.org/wsvn/python-modules/packages/ipy/branches/upstream/current/README?rev=1513&op=diff
==============================================================================
--- packages/ipy/branches/upstream/current/README (original)
+++ packages/ipy/branches/upstream/current/README Sun Nov 19 17:01:10 2006
@@ -80,15 +80,16 @@
By default, IPy rejects uncommon netmask like 172.30.1.0/22:
+ >>> import IPy
+ >>> IPy.check_addr_prefixlen = True # default value
>>> ips = IP('172.30.1.0/22')
Traceback (most recent call last):
...
- ValueError: 0xAC1E0100L goes not well with prefixlen 22
+ ValueError: IP('172.30.1.0/22') has invalid prefix length (22)
You can change this behaviour with global option check_addr_prefixlen:
- >>> import IPy
- >>> IPy.check_addr_prefixlen = False
+ >>> IPy.check_addr_prefixlen = False # disable
>>> ips = IP('172.30.1.0/22')
>>> len(ips)
1024
@@ -140,6 +141,18 @@
What's new?
===========
+Changes between version 0.51 and 0.52:
+
+ * Fix strCompressed() for IPv6 "ffff:ffff:ffff:ffff:ffff:f:f:fffc/127"
+
+Changes between version 0.5 and 0.51:
+
+ * Use real name of IPy author
+ * Use version "0.51" to help packaging since 0.5 was smaller than 0.42
+ * Fix unit test for Python 2.3 (don't use doctest.testfile)
+ * Fix unit test for Python 2.5 (problem of hex() lower case)
+ * IPy now works on Python 2.2 to 2.5
+
Changes between version 0.42 and 0.5: Fix all known bugs:
* Apply Jean Gillaux's patch for netmask "/0.0.0.0" bug
@@ -156,7 +169,9 @@
Compatibility and links
=======================
-IPy should work on Python version 2.1 to 2.5.
+IPy works on Python version 2.2 to 2.5.
+
+This Python module is under BSD license: see COPYING file.
Further Information might be available at: http://software.inl.fr/trac/trac.cgi/wiki/IPy
Modified: packages/ipy/branches/upstream/current/setup.py
URL: http://svn.debian.org/wsvn/python-modules/packages/ipy/branches/upstream/current/setup.py?rev=1513&op=diff
==============================================================================
--- packages/ipy/branches/upstream/current/setup.py (original)
+++ packages/ipy/branches/upstream/current/setup.py Sun Nov 19 17:01:10 2006
@@ -26,9 +26,9 @@
setup(name="IPy",
version=IPy.__version__,
- description="IPv4 and IPv6 parsing and handling class",
+ description="Class and tools for handling of IPv4 and IPv6 addresses and networks",
long_description=LONG_DESCRIPTION,
- author="drt",
+ author="Maximillian Dornseif",
maintainer="Victor Stinner",
maintainer_email="victor.stinner AT inl.fr",
license="BSD License",
Modified: packages/ipy/branches/upstream/current/test/test_IPy.py
URL: http://svn.debian.org/wsvn/python-modules/packages/ipy/branches/upstream/current/test/test_IPy.py?rev=1513&op=diff
==============================================================================
--- packages/ipy/branches/upstream/current/test/test_IPy.py (original)
+++ packages/ipy/branches/upstream/current/test/test_IPy.py Sun Nov 19 17:01:10 2006
@@ -148,27 +148,27 @@
(0xf, '0.0.0.15'),
(0xff, '0.0.0.255'),
(0xFFFFFFFFL, '255.255.255.255')]
- v6values = [(0x7f000001, '0000:0000:0000:0000:0000:0000:7F00:0001'),
+ v6values = [(0x7f000001, '0000:0000:0000:0000:0000:0000:7f00:0001'),
(0x0, '0000:0000:0000:0000:0000:0000:0000:0000'),
(0x1, '0000:0000:0000:0000:0000:0000:0000:0001'),
- (0xf, '0000:0000:0000:0000:0000:0000:0000:000F'),
- (0xff, '0000:0000:0000:0000:0000:0000:0000:00FF'),
- (0xFFFFFFFFL, '0000:0000:0000:0000:0000:0000:FFFF:FFFF'),
+ (0xf, '0000:0000:0000:0000:0000:0000:0000:000f'),
+ (0xff, '0000:0000:0000:0000:0000:0000:0000:00ff'),
+ (0xFFFFFFFFL, '0000:0000:0000:0000:0000:0000:ffff:ffff'),
(0x100000000L, '0000:0000:0000:0000:0000:0001:0000:0000'),
- (0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFL, 'FFFF:FFFF:FFFF:FFFF:FFFF:FFFF:FFFF:FFFF')]
+ (0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFL, 'ffff:ffff:ffff:ffff:ffff:ffff:ffff:ffff')]
def testKnownValuesv4(self):
"""printing of known IPv4 values should give known results"""
for x in self.v4values:
(question, answer) = x
- result = IPy.intToIp(question, 4)
+ result = IPy.intToIp(question, 4).lower()
self.assertEqual(answer, result, "%r, %r, %r" % (question, answer, result))
def testKnownValuesv6(self):
"""printing of known IPv6 values should give known results"""
for x in self.v6values:
(question, answer) = x
- result = IPy.intToIp(question, 6)
+ result = IPy.intToIp(question, 6).lower()
self.assertEqual(answer, result, "%r, %r, %r" % (question, answer, result))
def testNegativeIPv4(self):
@@ -564,16 +564,16 @@
def testStrHex(self):
"""Hex string Output."""
- testValues = [(338770000845734292534325025077361652240L, '0xFEDCBA9876543210FEDCBA9876543210'),
- (21932261930451111902915077091070067066L, '0x108000000000000000080800200C417A'),
- (338958331222012082418099330867817087043L, '0xFF010000000000000000000000000043'),
+ testValues = [(338770000845734292534325025077361652240L, '0xfedcba9876543210fedcba9876543210'),
+ (21932261930451111902915077091070067066L, '0x108000000000000000080800200c417a'),
+ (338958331222012082418099330867817087043L, '0xff010000000000000000000000000043'),
(0L, '0x0'),
(1L, '0x1'),
- (4294967295l, '0xFFFFFFFF'),
- (3588059479L, '0xD5DD7157'),
+ (4294967295l, '0xffffffff'),
+ (3588059479L, '0xd5dd7157'),
(0x12345678, '0x12345678')]
for (question, answer) in testValues:
- result = IPy.IP(question).strHex(question)
+ result = IPy.IP(question).strHex(question).lower()
self.failUnlessEqual(answer, result, (question, result, answer))
def testStrDec(self):
@@ -667,15 +667,15 @@
def testNetmask(self):
"""Normal string Output."""
- testValues = [(338770000845734292534325025077361652240L, '0xFEDCBA9876543210FEDCBA9876543210'),
- (21932261930451111902915077091070067066L, '0x108000000000000000080800200C417A'),
- (338958331222012082418099330867817087043L, '0xFF010000000000000000000000000043'),
+ testValues = [(338770000845734292534325025077361652240L, '0xfedcba9876543210fedcba9876543210'),
+ (21932261930451111902915077091070067066L, '0x108000000000000000080800200c417a'),
+ (338958331222012082418099330867817087043L, '0xff010000000000000000000000000043'),
(0L, '0x0'),
(1L, '0x1'),
- (4294967295l, '0xFFFFFFFF'),
- (3588059479L, '0xD5DD7157')]
+ (4294967295l, '0xffffffff'),
+ (3588059479L, '0xd5dd7157')]
for (question, answer) in testValues:
- result = IPy.IP(question).strHex(question)
+ result = IPy.IP(question).strHex(question).lower()
self.failUnlessEqual(answer, result, (question, result, answer))
# TODO
Added: packages/ipy/branches/upstream/current/test_doc.py
URL: http://svn.debian.org/wsvn/python-modules/packages/ipy/branches/upstream/current/test_doc.py?rev=1513&op=file
==============================================================================
--- packages/ipy/branches/upstream/current/test_doc.py (added)
+++ packages/ipy/branches/upstream/current/test_doc.py Sun Nov 19 17:01:10 2006
@@ -1,0 +1,19 @@
+#!/usr/bin/env python
+import doctest
+import sys
+if hasattr(doctest, "testfile"):
+ print "=== Test README ==="
+ failure, tests = doctest.testfile('README', optionflags=doctest.ELLIPSIS)
+
+ print "=== Test IPy ==="
+ import IPy
+ failure2, tests2 = doctest.testmod(IPy)
+ failure += failure2
+else:
+ sys.stderr.write("WARNING: doctest has no function testfile (before Python 2.4), unable to check README\n")
+ failure = 0
+if failure:
+ sys.exit(1)
+else:
+ sys.exit(0)
+
Propchange: packages/ipy/branches/upstream/current/test_doc.py
------------------------------------------------------------------------------
svn:executable = *
More information about the Python-modules-commits
mailing list