summaryrefslogtreecommitdiffstats
path: root/Lib/test
diff options
context:
space:
mode:
authorTim Peters <tim.peters@gmail.com>2003-05-12 20:19:37 (GMT)
committerTim Peters <tim.peters@gmail.com>2003-05-12 20:19:37 (GMT)
commitc2659cff5d88b81b6d9cc739ecc457a9ed357c58 (patch)
tree91de46cbaeee8ce7c3139b9b971a810326a2fcbc /Lib/test
parent0ff2ee0561302f8a5ce456e4c5c74acbf6ed73c5 (diff)
downloadcpython-c2659cff5d88b81b6d9cc739ecc457a9ed357c58.zip
cpython-c2659cff5d88b81b6d9cc739ecc457a9ed357c58.tar.gz
cpython-c2659cff5d88b81b6d9cc739ecc457a9ed357c58.tar.bz2
Whitespace normalization.
Diffstat (limited to 'Lib/test')
-rw-r--r--Lib/test/test_bool.py1
-rw-r--r--Lib/test/test_socket.py6
-rw-r--r--Lib/test/test_types.py8
-rw-r--r--Lib/test/test_urllib.py20
4 files changed, 17 insertions, 18 deletions
diff --git a/Lib/test/test_bool.py b/Lib/test/test_bool.py
index 4fbb0b1..dd18d84 100644
--- a/Lib/test/test_bool.py
+++ b/Lib/test/test_bool.py
@@ -325,4 +325,3 @@ def test_main():
if __name__ == "__main__":
test_main()
-
diff --git a/Lib/test/test_socket.py b/Lib/test/test_socket.py
index b9650e7..ab1e766 100644
--- a/Lib/test/test_socket.py
+++ b/Lib/test/test_socket.py
@@ -332,7 +332,7 @@ class GeneralModuleTests(unittest.TestCase):
self.assertEquals('\x00\x00\x00\x00', g('0.0.0.0'))
self.assertEquals('\xff\x00\xff\x00', g('255.0.255.0'))
self.assertEquals('\xaa\xaa\xaa\xaa', g('170.170.170.170'))
-
+
def testIPv6toString(self):
if not hasattr(socket, 'inet_pton'):
return # No inet_pton() on this platform
@@ -351,7 +351,7 @@ class GeneralModuleTests(unittest.TestCase):
'\x45\xef\x76\xcb\x00\x1a\x56\xef\xaf\xeb\x0b\xac\x19\x24\xae\xae',
f('45ef:76cb:1a:56ef:afeb:bac:1924:aeae')
)
-
+
def testStringToIPv4(self):
if not hasattr(socket, 'inet_ntop'):
return # No inet_ntop() on this platform
@@ -362,7 +362,7 @@ class GeneralModuleTests(unittest.TestCase):
self.assertEquals('170.85.170.85', f('\xaa\x55\xaa\x55'))
self.assertEquals('255.255.255.255', f('\xff\xff\xff\xff'))
self.assertEquals('1.2.3.4', f('\x01\x02\x03\x04'))
-
+
self.assertEquals('1.0.1.0', g('\x01\x00\x01\x00'))
self.assertEquals('170.85.170.85', g('\xaa\x55\xaa\x55'))
self.assertEquals('255.255.255.255', g('\xff\xff\xff\xff'))
diff --git a/Lib/test/test_types.py b/Lib/test/test_types.py
index 1532295..1cb1484 100644
--- a/Lib/test/test_types.py
+++ b/Lib/test/test_types.py
@@ -258,8 +258,8 @@ vereq(list(tuple(f())), range(1000))
# Verify that __getitem__ overrides are not recognized by __iter__
class T(tuple):
- def __getitem__(self, key):
- return str(key) + '!!!'
+ def __getitem__(self, key):
+ return str(key) + '!!!'
vereq(iter(T((1,2))).next(), 1)
print '6.5.3 Lists'
@@ -455,8 +455,8 @@ vereq(a, [0, 1, 1, 3, 2, 5, 3, 7, 4, 9])
# Verify that __getitem__ overrides are not recognized by __iter__
class L(list):
- def __getitem__(self, key):
- return str(key) + '!!!'
+ def __getitem__(self, key):
+ return str(key) + '!!!'
vereq(iter(L([1,2])).next(), 1)
diff --git a/Lib/test/test_urllib.py b/Lib/test/test_urllib.py
index 6afbe2f..9cb4dd2 100644
--- a/Lib/test/test_urllib.py
+++ b/Lib/test/test_urllib.py
@@ -139,14 +139,14 @@ class urlretrieve_FileTests(unittest.TestCase):
class QuotingTests(unittest.TestCase):
"""Tests for urllib.quote() and urllib.quote_plus()
-
+
According to RFC 2396 ("Uniform Resource Identifiers), to escape a
character you write it as '%' + <2 character US-ASCII hex value>. The Python
code of ``'%' + hex(ord(<character>))[2:]`` escapes a character properly.
Case does not matter on the hex letters.
The various character sets specified are:
-
+
Reserved characters : ";/?:@&=+$,"
Have special meaning in URIs and must be escaped if not being used for
their special meaning
@@ -160,7 +160,7 @@ class QuotingTests(unittest.TestCase):
Must be escaped
Unwise : "{}|\^[]`"
Must be escaped
-
+
"""
def test_never_quote(self):
@@ -206,7 +206,7 @@ class QuotingTests(unittest.TestCase):
result = urllib.quote_plus(char)
self.assertEqual(hexescape(char), result,
"using quote_plus(): "
- "%s should be escapes to %s, not %s" %
+ "%s should be escapes to %s, not %s" %
(char, hexescape(char), result))
del should_quote
partial_quote = "ab[]cd"
@@ -238,7 +238,7 @@ class QuotingTests(unittest.TestCase):
class UnquotingTests(unittest.TestCase):
"""Tests for unquote() and unquote_plus()
-
+
See the doc string for quoting_Tests for details on quoting and such.
"""
@@ -279,7 +279,7 @@ class UnquotingTests(unittest.TestCase):
result = urllib.unquote_plus(given)
self.assertEqual(expect, result,
"using unquote_plus(): %s != %s" % (expect, result))
-
+
def test_unquoting_plus(self):
# Test difference between unquote() and unquote_plus()
given = "are+there+spaces..."
@@ -297,15 +297,15 @@ class urlencode_Tests(unittest.TestCase):
def help_inputtype(self, given, test_type):
"""Helper method for testing different input types.
-
+
'given' must lead to only the pairs:
* 1st, 1
* 2nd, 2
* 3rd, 3
-
+
Test cannot assume anything about order. Docs make no guarantee and
have possible dictionary input.
-
+
"""
expect_somewhere = ["1st=1", "2nd=2", "3rd=3"]
result = urllib.urlencode(given)
@@ -404,7 +404,7 @@ class Pathname_Tests(unittest.TestCase):
self.assertEqual(expect, result,
"url2pathname() failed; %s != %s" %
(expect, result))
-
+
def test_main():