mirror of
https://github.com/python/cpython.git
synced 2025-07-24 03:35:53 +00:00
Whitespace normalization.
This commit is contained in:
parent
0e43db5baa
commit
27f883687b
15 changed files with 26 additions and 35 deletions
|
@ -101,7 +101,7 @@ class BinASCIITest(unittest.TestCase):
|
||||||
self.assertEqual(binascii.a2b_uu("\xff"), "\x00"*31)
|
self.assertEqual(binascii.a2b_uu("\xff"), "\x00"*31)
|
||||||
self.assertRaises(binascii.Error, binascii.a2b_uu, "\xff\x00")
|
self.assertRaises(binascii.Error, binascii.a2b_uu, "\xff\x00")
|
||||||
self.assertRaises(binascii.Error, binascii.a2b_uu, "!!!!")
|
self.assertRaises(binascii.Error, binascii.a2b_uu, "!!!!")
|
||||||
|
|
||||||
self.assertRaises(binascii.Error, binascii.b2a_uu, 46*"!")
|
self.assertRaises(binascii.Error, binascii.b2a_uu, 46*"!")
|
||||||
|
|
||||||
def test_crc32(self):
|
def test_crc32(self):
|
||||||
|
|
|
@ -343,7 +343,7 @@ def test_main():
|
||||||
RecodingTest,
|
RecodingTest,
|
||||||
PunycodeTest,
|
PunycodeTest,
|
||||||
NameprepTest,
|
NameprepTest,
|
||||||
CodecTest
|
CodecTest
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -133,7 +133,7 @@ class Test_Csv(unittest.TestCase):
|
||||||
finally:
|
finally:
|
||||||
fileobj.close()
|
fileobj.close()
|
||||||
os.unlink(name)
|
os.unlink(name)
|
||||||
|
|
||||||
def _read_test(self, input, expect, **kwargs):
|
def _read_test(self, input, expect, **kwargs):
|
||||||
reader = csv.reader(input, **kwargs)
|
reader = csv.reader(input, **kwargs)
|
||||||
result = list(reader)
|
result = list(reader)
|
||||||
|
@ -226,7 +226,7 @@ class TestDialectRegistry(unittest.TestCase):
|
||||||
finally:
|
finally:
|
||||||
fileobj.close()
|
fileobj.close()
|
||||||
os.unlink(name)
|
os.unlink(name)
|
||||||
|
|
||||||
def test_dialect_apply(self):
|
def test_dialect_apply(self):
|
||||||
class testA(csv.excel):
|
class testA(csv.excel):
|
||||||
delimiter = "\t"
|
delimiter = "\t"
|
||||||
|
@ -247,7 +247,7 @@ class TestDialectRegistry(unittest.TestCase):
|
||||||
finally:
|
finally:
|
||||||
fileobj.close()
|
fileobj.close()
|
||||||
os.unlink(name)
|
os.unlink(name)
|
||||||
|
|
||||||
fd, name = tempfile.mkstemp()
|
fd, name = tempfile.mkstemp()
|
||||||
fileobj = os.fdopen(fd, "w+b")
|
fileobj = os.fdopen(fd, "w+b")
|
||||||
try:
|
try:
|
||||||
|
|
|
@ -259,9 +259,3 @@ def test_main(verbose=None):
|
||||||
|
|
||||||
if __name__ == "__main__":
|
if __name__ == "__main__":
|
||||||
test_main(verbose=True)
|
test_main(verbose=True)
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -126,4 +126,3 @@ def test_main(verbose=None):
|
||||||
|
|
||||||
if __name__ == "__main__":
|
if __name__ == "__main__":
|
||||||
test_main(verbose=True)
|
test_main(verbose=True)
|
||||||
|
|
||||||
|
|
|
@ -204,7 +204,7 @@ DOCTYPE html [
|
||||||
self._run_check("<e a=rgb(1,2,3)>", [
|
self._run_check("<e a=rgb(1,2,3)>", [
|
||||||
("starttag", "e", [("a", "rgb(1,2,3)")]),
|
("starttag", "e", [("a", "rgb(1,2,3)")]),
|
||||||
])
|
])
|
||||||
# Regression test for SF bug #921657.
|
# Regression test for SF bug #921657.
|
||||||
self._run_check("<a href=mailto:xyz@example.com>", [
|
self._run_check("<a href=mailto:xyz@example.com>", [
|
||||||
("starttag", "a", [("href", "mailto:xyz@example.com")]),
|
("starttag", "a", [("href", "mailto:xyz@example.com")]),
|
||||||
])
|
])
|
||||||
|
|
|
@ -252,7 +252,7 @@ class TestIsInstanceIsSubclass(unittest.TestCase):
|
||||||
|
|
||||||
def test_isinstance_recursion_limit(self):
|
def test_isinstance_recursion_limit(self):
|
||||||
# make sure that issubclass raises RuntimeError before the C stack is
|
# make sure that issubclass raises RuntimeError before the C stack is
|
||||||
# blown
|
# blown
|
||||||
self.assertRaises(RuntimeError, blowstack, isinstance, '', str)
|
self.assertRaises(RuntimeError, blowstack, isinstance, '', str)
|
||||||
|
|
||||||
def blowstack(fxn, arg, compare_to):
|
def blowstack(fxn, arg, compare_to):
|
||||||
|
|
|
@ -52,13 +52,13 @@ n = 10
|
||||||
class TestInvariantWithoutMutations(unittest.TestCase):
|
class TestInvariantWithoutMutations(unittest.TestCase):
|
||||||
|
|
||||||
def test_invariant(self):
|
def test_invariant(self):
|
||||||
it = self.it
|
it = self.it
|
||||||
for i in reversed(xrange(1, n+1)):
|
for i in reversed(xrange(1, n+1)):
|
||||||
self.assertEqual(len(it), i)
|
self.assertEqual(len(it), i)
|
||||||
it.next()
|
it.next()
|
||||||
self.assertEqual(len(it), 0)
|
self.assertEqual(len(it), 0)
|
||||||
self.assertRaises(StopIteration, it.next)
|
self.assertRaises(StopIteration, it.next)
|
||||||
self.assertEqual(len(it), 0)
|
self.assertEqual(len(it), 0)
|
||||||
|
|
||||||
class TestTemporarilyImmutable(TestInvariantWithoutMutations):
|
class TestTemporarilyImmutable(TestInvariantWithoutMutations):
|
||||||
|
|
||||||
|
|
|
@ -167,7 +167,7 @@ class TestBase_Mapping(unittest.TestCase):
|
||||||
parent = os.path.join(os.pardir, self.mapfilename)
|
parent = os.path.join(os.pardir, self.mapfilename)
|
||||||
if not os.path.exists(parent):
|
if not os.path.exists(parent):
|
||||||
format = '%s not found, download from %s'
|
format = '%s not found, download from %s'
|
||||||
raise test_support.TestSkipped(format %
|
raise test_support.TestSkipped(format %
|
||||||
(self.mapfilename, self.mapfileurl))
|
(self.mapfilename, self.mapfileurl))
|
||||||
else:
|
else:
|
||||||
self.mapfilename = parent
|
self.mapfilename = parent
|
||||||
|
|
|
@ -86,14 +86,14 @@ class C:
|
||||||
|
|
||||||
|
|
||||||
def test_2():
|
def test_2():
|
||||||
d = globals().copy()
|
d = globals().copy()
|
||||||
def testfunc():
|
def testfunc():
|
||||||
global x
|
global x
|
||||||
x = 1
|
x = 1
|
||||||
d['testfunc'] = testfunc
|
d['testfunc'] = testfunc
|
||||||
profile.runctx("testfunc()", d, d, TESTFN)
|
profile.runctx("testfunc()", d, d, TESTFN)
|
||||||
vereq (x, 1)
|
vereq (x, 1)
|
||||||
os.unlink (TESTFN)
|
os.unlink (TESTFN)
|
||||||
|
|
||||||
if __name__ == "__main__":
|
if __name__ == "__main__":
|
||||||
test_main()
|
test_main()
|
||||||
|
|
|
@ -85,7 +85,7 @@ class TclTest(unittest.TestCase):
|
||||||
def testUnsetVarException(self):
|
def testUnsetVarException(self):
|
||||||
tcl = self.interp
|
tcl = self.interp
|
||||||
self.assertRaises(TclError,tcl.unsetvar,'a')
|
self.assertRaises(TclError,tcl.unsetvar,'a')
|
||||||
|
|
||||||
def testEvalFile(self):
|
def testEvalFile(self):
|
||||||
tcl = self.interp
|
tcl = self.interp
|
||||||
filename = "testEvalFile.tcl"
|
filename = "testEvalFile.tcl"
|
||||||
|
|
|
@ -128,7 +128,7 @@ What a mess!
|
||||||
wrapper.width = 60
|
wrapper.width = 60
|
||||||
expect = ['And she said, "Go to hell!" Can you believe that?']
|
expect = ['And she said, "Go to hell!" Can you believe that?']
|
||||||
self.check(wrapper.wrap(text), expect)
|
self.check(wrapper.wrap(text), expect)
|
||||||
|
|
||||||
def test_wrap_short(self):
|
def test_wrap_short(self):
|
||||||
# Wrapping to make short lines longer
|
# Wrapping to make short lines longer
|
||||||
|
|
||||||
|
|
|
@ -678,7 +678,7 @@ class NetworkTests(unittest.TestCase):
|
||||||
data = result.read()
|
data = result.read()
|
||||||
self.assertEqual(len(data), 20)
|
self.assertEqual(len(data), 20)
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
def test_main(verbose=None):
|
def test_main(verbose=None):
|
||||||
tests = (TrivialTests,
|
tests = (TrivialTests,
|
||||||
|
|
|
@ -38,4 +38,3 @@ else:
|
||||||
diff = difflib.context_diff(fromlines, tolines, fromfile, tofile, fromdate, todate, n=n)
|
diff = difflib.context_diff(fromlines, tolines, fromfile, tofile, fromdate, todate, n=n)
|
||||||
|
|
||||||
sys.stdout.writelines(diff)
|
sys.stdout.writelines(diff)
|
||||||
|
|
||||||
|
|
|
@ -230,4 +230,3 @@ def main(args=None):
|
||||||
|
|
||||||
if __name__ == '__main__':
|
if __name__ == '__main__':
|
||||||
sys.exit(main())
|
sys.exit(main())
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue