[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]

[tor-commits] [bridgedb/master] Move old b.Bridges.is_valid_ip() doctest to b.p.addr.isValidIP().



commit fc07c5b64de89a63b0518864b3b8d250e1503533
Author: Isis Lovecruft <isis@xxxxxxxxxxxxxx>
Date:   Wed Jun 11 00:09:08 2014 +0000

    Move old b.Bridges.is_valid_ip() doctest to b.p.addr.isValidIP().
---
 lib/bridgedb/parse/addr.py |   29 ++++++++++++++---------------
 1 file changed, 14 insertions(+), 15 deletions(-)

diff --git a/lib/bridgedb/parse/addr.py b/lib/bridgedb/parse/addr.py
index ace4c80..01acf58 100644
--- a/lib/bridgedb/parse/addr.py
+++ b/lib/bridgedb/parse/addr.py
@@ -320,21 +320,6 @@ def isIPAddress(ip, compressed=True):
 def _isIPv(version, ip):
     """Check if **ip** is a certain **version** (IPv4 or IPv6).
 
-    >>> from bridgedb.parse.addr import isValidIP
-    >>> isValidIP('1.2.3.4')
-    True
-    >>> isValidIP('1.2.3.255')
-    True
-    >>> isValidIP('1.2.3.256')
-    False
-    >>> isValidIP('1')
-    False
-    >>> isValidIP('1.2.3')
-    False
-    >>> isValidIP('xyzzy')
-    False
-
-
     .. warning: Do *not* put any calls to the logging module in this function,
         or else an infinite recursion will occur when the call is made, due
         the the log :class:`~logging.Filter`s in :mod:`~bridgedb.safelog`
@@ -397,6 +382,20 @@ def isValidIP(ip):
 
       * A :term:`Site-Local Address` or an :term:`Unique Local Address`.
 
+    >>> from bridgedb.parse.addr import isValidIP
+    >>> isValidIP('1.2.3.4')
+    True
+    >>> isValidIP('1.2.3.255')
+    True
+    >>> isValidIP('1.2.3.256')
+    False
+    >>> isValidIP('1')
+    False
+    >>> isValidIP('1.2.3')
+    False
+    >>> isValidIP('xyzzy')
+    False
+
     :type ip: An :class:`ipaddr.IPAddress`, :class:`ipaddr.IPv4Address`, or
         :class:`ipaddr.IPv6Address`.
     :param ip: An ``ipaddr.IPAddress`` class.



_______________________________________________
tor-commits mailing list
tor-commits@xxxxxxxxxxxxxxxxxxxx
https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-commits