diff options
author | Tim Peters <tim.peters@gmail.com> | 2002-04-16 01:38:40 (GMT) |
---|---|---|
committer | Tim Peters <tim.peters@gmail.com> | 2002-04-16 01:38:40 (GMT) |
commit | 863ac44b74cd66f7d289748816d65c65808c149b (patch) | |
tree | 8536f8a72110b9996cb9e6746b6bb4cf3cb73733 /Lib/test | |
parent | c86c1b88f96ec48e5502b9b8ba5cc833f57ce476 (diff) | |
download | cpython-863ac44b74cd66f7d289748816d65c65808c149b.zip cpython-863ac44b74cd66f7d289748816d65c65808c149b.tar.gz cpython-863ac44b74cd66f7d289748816d65c65808c149b.tar.bz2 |
Whitespace normalization.
Diffstat (limited to 'Lib/test')
-rw-r--r-- | Lib/test/pickletester.py | 2 | ||||
-rw-r--r-- | Lib/test/string_tests.py | 2 | ||||
-rw-r--r-- | Lib/test/test_cfgparser.py | 2 | ||||
-rw-r--r-- | Lib/test/test_email.py | 52 | ||||
-rw-r--r-- | Lib/test/test_longexp.py | 6 | ||||
-rw-r--r-- | Lib/test/test_mpz.py | 1 | ||||
-rw-r--r-- | Lib/test/test_netrc.py | 9 | ||||
-rw-r--r-- | Lib/test/test_robotparser.py | 18 | ||||
-rw-r--r-- | Lib/test/test_types.py | 2 | ||||
-rw-r--r-- | Lib/test/test_unicode.py | 2 | ||||
-rw-r--r-- | Lib/test/test_univnewlines.py | 30 | ||||
-rw-r--r-- | Lib/test/test_urlparse.py | 1 |
12 files changed, 62 insertions, 65 deletions
diff --git a/Lib/test/pickletester.py b/Lib/test/pickletester.py index e16428f..2576e8f 100644 --- a/Lib/test/pickletester.py +++ b/Lib/test/pickletester.py @@ -253,7 +253,7 @@ class AbstractPickleTests(unittest.TestCase): t = time.localtime() s = self.dumps(t) u = self.loads(s) - self.assertEqual(t, u) + self.assertEqual(t, u) import os if hasattr(os, "stat"): t = os.stat(os.curdir) diff --git a/Lib/test/string_tests.py b/Lib/test/string_tests.py index ea25983..180072c 100644 --- a/Lib/test/string_tests.py +++ b/Lib/test/string_tests.py @@ -239,7 +239,7 @@ def run_method_tests(test): test('zfill', '', '000', 3) test('zfill', '34', '34', 1) test('zfill', '34', '0034', 4) - + # Encoding/decoding codecs = [('rot13', 'uryyb jbeyq'), ('base64', 'aGVsbG8gd29ybGQ=\n'), diff --git a/Lib/test/test_cfgparser.py b/Lib/test/test_cfgparser.py index 57e7125..6a6fecb 100644 --- a/Lib/test/test_cfgparser.py +++ b/Lib/test/test_cfgparser.py @@ -67,7 +67,7 @@ foo = another very foo = this line is much, much longer than my editor likes it. """) - + def case_sensitivity(): print "Testing case sensitivity..." cf = ConfigParser.ConfigParser() diff --git a/Lib/test/test_email.py b/Lib/test/test_email.py index efbe271..7b3f063 100644 --- a/Lib/test/test_email.py +++ b/Lib/test/test_email.py @@ -313,7 +313,7 @@ class TestMessageAPI(TestEmailBase): msg.del_param("report-type") eq(msg.get_params(), [('multipart/report', ''), - ('boundary', 'D1690A7AC1.996856090/mail.example.com')]) + ('boundary', 'D1690A7AC1.996856090/mail.example.com')]) msg.set_param("report-type", old_val) eq(msg.get_params(), [('multipart/report', ''), @@ -331,7 +331,7 @@ class TestMessageAPI(TestEmailBase): msg.set_type('text/html') eq(msg['content-type'], 'text/html; charset="us-ascii"') - + # Test the email.Encoders module class TestEncoders(unittest.TestCase): @@ -409,7 +409,7 @@ Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Foobar-Spoink-Defrobnit: wasnipoop; giraffes="very-long-necked-animals"; - spooge="yummy"; hippos="gargantuan"; marshmallows="gooey" + spooge="yummy"; hippos="gargantuan"; marshmallows="gooey" ''') @@ -450,22 +450,22 @@ Test""") msg = Message() msg['Received'] = """\ from babylon.socal-raves.org (localhost [127.0.0.1]); by babylon.socal-raves.org (Postfix) with ESMTP id B570E51B81; for <mailman-admin@babylon.socal-raves.org>; Sat, 2 Feb 2002 17:00:06 -0800 (PST) - from babylon.socal-raves.org (localhost [127.0.0.1]); by babylon.socal-raves.org (Postfix) with ESMTP id B570E51B81; for <mailman-admin@babylon.socal-raves.org>; Sat, 2 Feb 2002 17:00:06 -0800 (PST) - from babylon.socal-raves.org (localhost [127.0.0.1]); by babylon.socal-raves.org (Postfix) with ESMTP id B570E51B81; for <mailman-admin@babylon.socal-raves.org>; Sat, 2 Feb 2002 17:00:06 -0800 (PST) + from babylon.socal-raves.org (localhost [127.0.0.1]); by babylon.socal-raves.org (Postfix) with ESMTP id B570E51B81; for <mailman-admin@babylon.socal-raves.org>; Sat, 2 Feb 2002 17:00:06 -0800 (PST) + from babylon.socal-raves.org (localhost [127.0.0.1]); by babylon.socal-raves.org (Postfix) with ESMTP id B570E51B81; for <mailman-admin@babylon.socal-raves.org>; Sat, 2 Feb 2002 17:00:06 -0800 (PST) """ self.assertEqual(msg.as_string(), """\ Received: from babylon.socal-raves.org (localhost [127.0.0.1]); - by babylon.socal-raves.org (Postfix) with ESMTP id B570E51B81; - for <mailman-admin@babylon.socal-raves.org>; - Sat, 2 Feb 2002 17:00:06 -0800 (PST) - from babylon.socal-raves.org (localhost [127.0.0.1]); - by babylon.socal-raves.org (Postfix) with ESMTP id B570E51B81; - for <mailman-admin@babylon.socal-raves.org>; - Sat, 2 Feb 2002 17:00:06 -0800 (PST) - from babylon.socal-raves.org (localhost [127.0.0.1]); - by babylon.socal-raves.org (Postfix) with ESMTP id B570E51B81; - for <mailman-admin@babylon.socal-raves.org>; - Sat, 2 Feb 2002 17:00:06 -0800 (PST) + by babylon.socal-raves.org (Postfix) with ESMTP id B570E51B81; + for <mailman-admin@babylon.socal-raves.org>; + Sat, 2 Feb 2002 17:00:06 -0800 (PST) + from babylon.socal-raves.org (localhost [127.0.0.1]); + by babylon.socal-raves.org (Postfix) with ESMTP id B570E51B81; + for <mailman-admin@babylon.socal-raves.org>; + Sat, 2 Feb 2002 17:00:06 -0800 (PST) + from babylon.socal-raves.org (localhost [127.0.0.1]); + by babylon.socal-raves.org (Postfix) with ESMTP id B570E51B81; + for <mailman-admin@babylon.socal-raves.org>; + Sat, 2 Feb 2002 17:00:06 -0800 (PST) """) @@ -721,7 +721,7 @@ From: bperson@dom.ain --BOUNDARY-- -''') +''') def test_one_part_in_a_multipart(self): outer = MIMEBase('multipart', 'mixed') @@ -748,7 +748,7 @@ Content-Transfer-Encoding: 7bit hello world --BOUNDARY-- -''') +''') def test_seq_parts_in_a_multipart(self): outer = MIMEBase('multipart', 'mixed') @@ -775,7 +775,7 @@ Content-Transfer-Encoding: 7bit hello world --BOUNDARY-- -''') +''') @@ -1163,11 +1163,11 @@ class TestMiscellaneous(unittest.TestCase): module = __import__('email') all = module.__all__ all.sort() - self.assertEqual(all, ['Charset', 'Encoders', 'Errors', 'Generator', - 'Header', 'Iterators', 'MIMEAudio', - 'MIMEBase', 'MIMEImage', 'MIMEMessage', + self.assertEqual(all, ['Charset', 'Encoders', 'Errors', 'Generator', + 'Header', 'Iterators', 'MIMEAudio', + 'MIMEBase', 'MIMEImage', 'MIMEMessage', 'MIMEText', 'Message', 'Parser', - 'Utils', 'base64MIME', + 'Utils', 'base64MIME', 'message_from_file', 'message_from_string', 'quopriMIME']) @@ -1313,7 +1313,7 @@ class TestParsers(unittest.TestCase): From: aperson@dom.ain To: bperson@dom.ain Subject: the next line has a space on it - + Date: Mon, 8 Apr 2002 15:09:19 -0400 Message-ID: spam @@ -1367,7 +1367,7 @@ eHh4eCB4eHh4IHh4eHggeHh4eCB4eHh4IHh4eHgg\r eHh4eCB4eHh4IHh4eHggeHh4eCB4eHh4IHh4eHgg\r eHh4eCB4eHh4IA==\r """) - + def test_header_encode(self): eq = self.assertEqual he = base64MIME.header_encode @@ -1504,7 +1504,7 @@ two line"""), """\ one line two line""") - + # Test the Charset class diff --git a/Lib/test/test_longexp.py b/Lib/test/test_longexp.py index 00ece6d..b7842f9 100644 --- a/Lib/test/test_longexp.py +++ b/Lib/test/test_longexp.py @@ -6,9 +6,9 @@ from test_support import TestFailed, TestSkipped REPS = 65580 if sys.platform == 'mac': - import gestalt - if gestalt.gestalt('sysv') > 0x9ff: - raise TestSkipped, 'Triggers pathological malloc slowdown on OSX MacPython' + import gestalt + if gestalt.gestalt('sysv') > 0x9ff: + raise TestSkipped, 'Triggers pathological malloc slowdown on OSX MacPython' if sys.platform == "os2emx": raise TestFailed, "OS/2+EMX port has malloc problems with long expressions" else: diff --git a/Lib/test/test_mpz.py b/Lib/test/test_mpz.py index 2e57db4..804dc6b 100644 --- a/Lib/test/test_mpz.py +++ b/Lib/test/test_mpz.py @@ -87,4 +87,3 @@ else: raise TestFailed, 'gcdext(10, 10.) should raise a TypeError' try: mpz.mpz(-10).binary() except ValueError: pass else: raise TestFailed, 'mpz(-10).binary() should raise a ValueError' - diff --git a/Lib/test/test_netrc.py b/Lib/test/test_netrc.py index 5922fdc..2cf1ae4 100644 --- a/Lib/test/test_netrc.py +++ b/Lib/test/test_netrc.py @@ -12,7 +12,7 @@ macdef macro2 line3 line4 -default login log2 password pass2 +default login log2 password pass2 """ @@ -25,7 +25,7 @@ class NetrcTestCase(unittest.TestCase): fp.write(TEST_NETRC) fp.close() self.netrc = netrc.netrc(temp_filename) - + def tearDown (self): del self.netrc os.unlink(temp_filename) @@ -36,8 +36,7 @@ class NetrcTestCase(unittest.TestCase): ) self.assert_(self.netrc.hosts['foo'] == ('log1', 'acct1', 'pass1')) self.assert_(self.netrc.hosts['default'] == ('log2', None, 'pass2')) - - + + if __name__ == "__main__": test_support.run_unittest(NetrcTestCase) - diff --git a/Lib/test/test_robotparser.py b/Lib/test/test_robotparser.py index a010725..beec006 100644 --- a/Lib/test/test_robotparser.py +++ b/Lib/test/test_robotparser.py @@ -30,14 +30,14 @@ tests = unittest.TestSuite() def RobotTest(index, robots_txt, good_urls, bad_urls, agent="test_robotparser"): - - lines = StringIO.StringIO(robots_txt).readlines() - parser = robotparser.RobotFileParser() - parser.parse(lines) - for url in good_urls: - tests.addTest(RobotTestCase(index, parser, url, 1, agent)) - for url in bad_urls: - tests.addTest(RobotTestCase(index, parser, url, 0, agent)) + + lines = StringIO.StringIO(robots_txt).readlines() + parser = robotparser.RobotFileParser() + parser.parse(lines) + for url in good_urls: + tests.addTest(RobotTestCase(index, parser, url, 1, agent)) + for url in bad_urls: + tests.addTest(RobotTestCase(index, parser, url, 0, agent)) # Examples from http://www.robotstxt.org/wc/norobots.html (fetched 2002) @@ -116,7 +116,7 @@ Disallow: /%7ejoe/index.html good = ['/tmp',] # XFAIL: '/a%2fb.html' bad = ['/tmp/','/tmp/a.html', '/a%3cd.html','/a%3Cd.html',"/a/b.html", - '/%7Ejoe/index.html'] + '/%7Ejoe/index.html'] RobotTest(6, doc, good, bad) diff --git a/Lib/test/test_types.py b/Lib/test/test_types.py index 9d4508b..fc30e5b 100644 --- a/Lib/test/test_types.py +++ b/Lib/test/test_types.py @@ -494,7 +494,7 @@ else: raise TestFailed, "{}.pop(k) doesn't raise KeyError when dictionary is emp d[1] = 1 try: for i in d: - d[i+1] = 1 + d[i+1] = 1 except RuntimeError: pass else: diff --git a/Lib/test/test_unicode.py b/Lib/test/test_unicode.py index 29dd819..c04d929 100644 --- a/Lib/test/test_unicode.py +++ b/Lib/test/test_unicode.py @@ -523,7 +523,7 @@ verify(u'\u6b63\u78ba\u306b\u8a00\u3046\u3068\u7ffb\u8a33\u306f' u'\u90e8\u306f\u30c9\u30a4\u30c4\u8a9e\u3067\u3059\u304c' u'\u3001\u3042\u3068\u306f\u3067\u305f\u3089\u3081\u3067' u'\u3059\u3002\u5b9f\u969b\u306b\u306f\u300cWenn ist das' - u' Nunstuck git und'.encode('utf-8') == + u' Nunstuck git und'.encode('utf-8') == '\xe6\xad\xa3\xe7\xa2\xba\xe3\x81\xab\xe8\xa8\x80\xe3\x81' '\x86\xe3\x81\xa8\xe7\xbf\xbb\xe8\xa8\xb3\xe3\x81\xaf\xe3' '\x81\x95\xe3\x82\x8c\xe3\x81\xa6\xe3\x81\x84\xe3\x81\xbe' diff --git a/Lib/test/test_univnewlines.py b/Lib/test/test_univnewlines.py index e77797a..8d6a874 100644 --- a/Lib/test/test_univnewlines.py +++ b/Lib/test/test_univnewlines.py @@ -5,11 +5,11 @@ import os import sys DATA_TEMPLATE=[ - "line1=1", - "line2='this is a very long line designed to go past the magic " + - "hundred character limit that is inside fileobject.c and which " + - "is meant to speed up the common case, but we also want to test " + - "the uncommon case, naturally.'", + "line1=1", + "line2='this is a very long line designed to go past the magic " + + "hundred character limit that is inside fileobject.c and which " + + "is meant to speed up the common case, but we also want to test " + + "the uncommon case, naturally.'", "def line3():pass" ] DATA_LF = "\n".join(DATA_TEMPLATE) + "\n" @@ -40,13 +40,13 @@ class TestGenericUnivNewlines(unittest.TestCase): os.unlink(test_support.TESTFN) except: pass - + def test_read(self): fp = open(test_support.TESTFN, self.READMODE) data = fp.read() self.assertEqual(data, DATA_LF) self.assertEqual(`fp.newlines`, `self.NEWLINE`) - + def test_readlines(self): fp = open(test_support.TESTFN, self.READMODE) data = fp.readlines() @@ -62,7 +62,7 @@ class TestGenericUnivNewlines(unittest.TestCase): d = fp.readline() self.assertEqual(data, DATA_SPLIT) self.assertEqual(`fp.newlines`, `self.NEWLINE`) - + def test_seek(self): fp = open(test_support.TESTFN, self.READMODE) fp.readline() @@ -72,36 +72,36 @@ class TestGenericUnivNewlines(unittest.TestCase): fp.seek(pos) data = fp.readlines() self.assertEqual(data, DATA_SPLIT[1:]) - + def test_execfile(self): dict = {} execfile(test_support.TESTFN, dict) func = dict['line3'] self.assertEqual(func.func_code.co_firstlineno, 3) - + class TestNativeNewlines(TestGenericUnivNewlines): NEWLINE=None DATA=DATA_LF READMODE='r' WRITEMODE='w' - + class TestCRNewlines(TestGenericUnivNewlines): NEWLINE='\r' DATA=DATA_CR - + class TestLFNewlines(TestGenericUnivNewlines): NEWLINE='\n' DATA=DATA_LF - + class TestCRLFNewlines(TestGenericUnivNewlines): NEWLINE='\r\n' DATA=DATA_CRLF - + class TestMixedNewlines(TestGenericUnivNewlines): NEWLINE=('\r', '\n') DATA=DATA_MIXED - + def test_main(): test_support.run_unittest(TestNativeNewlines) diff --git a/Lib/test/test_urlparse.py b/Lib/test/test_urlparse.py index dbe0283..2b3cf6c 100644 --- a/Lib/test/test_urlparse.py +++ b/Lib/test/test_urlparse.py @@ -123,4 +123,3 @@ def test_main(): if __name__ == "__main__": test_main() - |