[Python-checkins] CVS: python/dist/src/Lib/test test___all__.py,1.18,1.19 test_codeop.py,1.1,1.2 test_glob.py,1.1,1.2 test_gzip.py,1.7,1.8 test_mhlib.py,1.2,1.3 test_pkgimport.py,1.2,1.3 test_repr.py,1.1,1.2
Tim Peters
tim_one@users.sourceforge.net
2001年8月09日 14:40:32 -0700
- Previous message: [Python-checkins] CVS: python/dist/src/Lib cgi.py,1.65,1.66 cmd.py,1.25,1.26 gzip.py,1.25,1.26 urllib.py,1.129,1.130 urllib2.py,1.17,1.18
- Next message: [Python-checkins] CVS: python/dist/src/Doc/lib libstdtypes.tex,1.52.4.2,1.52.4.3
- Messages sorted by:
[ date ]
[ thread ]
[ subject ]
[ author ]
Update of /cvsroot/python/python/dist/src/Lib/test
In directory usw-pr-cvs1:/tmp/cvs-serv17028/python/dist/src/Lib/test
Modified Files:
test___all__.py test_codeop.py test_glob.py test_gzip.py
test_mhlib.py test_pkgimport.py test_repr.py
Log Message:
Whitespace normalization.
Index: test___all__.py
===================================================================
RCS file: /cvsroot/python/python/dist/src/Lib/test/test___all__.py,v
retrieving revision 1.18
retrieving revision 1.19
diff -C2 -d -r1.18 -r1.19
*** test___all__.py 2001年08月04日 22:22:19 1.18
--- test___all__.py 2001年08月09日 21:40:30 1.19
***************
*** 42,46 ****
# than an AttributeError somewhere deep in CGIHTTPServer.
import _socket
!
check_all("BaseHTTPServer")
check_all("CGIHTTPServer")
--- 42,46 ----
# than an AttributeError somewhere deep in CGIHTTPServer.
import _socket
!
check_all("BaseHTTPServer")
check_all("CGIHTTPServer")
Index: test_codeop.py
===================================================================
RCS file: /cvsroot/python/python/dist/src/Lib/test/test_codeop.py,v
retrieving revision 1.1
retrieving revision 1.2
diff -C2 -d -r1.1 -r1.2
*** test_codeop.py 2001年07月30日 12:30:08 1.1
--- test_codeop.py 2001年08月09日 21:40:30 1.2
***************
*** 14,18 ****
expected = compile(str, "<input>", symbol)
self.assertEquals( compile_command(str, "<input>", symbol), expected)
!
def assertIncomplete(self, str, symbol='single'):
--- 14,18 ----
expected = compile(str, "<input>", symbol)
self.assertEquals( compile_command(str, "<input>", symbol), expected)
!
def assertIncomplete(self, str, symbol='single'):
***************
*** 42,46 ****
# special case
! self.assertEquals(compile_command(""),
compile("pass", "<input>", 'single'))
--- 42,46 ----
# special case
! self.assertEquals(compile_command(""),
compile("pass", "<input>", 'single'))
***************
*** 48,52 ****
av("(lambda z: \n z**3)","eval")
av("#a\n#b\na**3","eval")
!
def test_incomplete(self):
ai = self.assertIncomplete
--- 48,52 ----
av("(lambda z: \n z**3)","eval")
av("#a\n#b\na**3","eval")
!
def test_incomplete(self):
ai = self.assertIncomplete
***************
*** 60,64 ****
ai("a = (")
ai("a = 9+ \\")
!
ai("(","eval")
ai("(\n\n\n","eval")
--- 60,64 ----
ai("a = (")
ai("a = 9+ \\")
!
ai("(","eval")
ai("(\n\n\n","eval")
Index: test_glob.py
===================================================================
RCS file: /cvsroot/python/python/dist/src/Lib/test/test_glob.py,v
retrieving revision 1.1
retrieving revision 1.2
diff -C2 -d -r1.1 -r1.2
*** test_glob.py 2001年07月23日 16:08:36 1.1
--- test_glob.py 2001年08月09日 21:40:30 1.2
***************
*** 108,110 ****
run_unittest(GlobTests)
-
--- 108,109 ----
Index: test_gzip.py
===================================================================
RCS file: /cvsroot/python/python/dist/src/Lib/test/test_gzip.py,v
retrieving revision 1.7
retrieving revision 1.8
diff -C2 -d -r1.7 -r1.8
*** test_gzip.py 2001年08月09日 07:21:56 1.7
--- test_gzip.py 2001年08月09日 21:40:30 1.8
***************
*** 72,76 ****
f = gzip.GzipFile(filename, 'w')
for pos in range(0, 256, 16):
! f.seek(pos)
f.write('GZ\n')
f.close()
--- 72,76 ----
f = gzip.GzipFile(filename, 'w')
for pos in range(0, 256, 16):
! f.seek(pos)
f.write('GZ\n')
f.close()
Index: test_mhlib.py
===================================================================
RCS file: /cvsroot/python/python/dist/src/Lib/test/test_mhlib.py,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -d -r1.2 -r1.3
*** test_mhlib.py 2001年08月09日 21:34:54 1.2
--- test_mhlib.py 2001年08月09日 21:40:30 1.3
***************
*** 44,48 ****
def writeContext(folder):
folder = normF(folder)
! writeFile(os.path.join(_mhpath, "context"),
"Current-Folder: %s\n" % folder)
--- 44,48 ----
def writeContext(folder):
folder = normF(folder)
! writeFile(os.path.join(_mhpath, "context"),
"Current-Folder: %s\n" % folder)
***************
*** 97,101 ****
deltree(_mhroot)
mkdirs(_mhpath)
! writeProfile({'Path' : os.path.abspath(_mhpath),
'Editor': 'emacs',
'ignored-attribute': 'camping holiday'})
--- 97,101 ----
deltree(_mhroot)
mkdirs(_mhpath)
! writeProfile({'Path' : os.path.abspath(_mhpath),
'Editor': 'emacs',
'ignored-attribute': 'camping holiday'})
***************
*** 104,125 ****
# An inbox with a couple of messages.
! writeMessage('inbox', 1,
{'From': 'Mrs. Premise',
'To': 'Mrs. Conclusion',
'Date': '18 July 2001'}, "Hullo, Mrs. Conclusion!\n")
! writeMessage('inbox', 2,
{'From': 'Mrs. Conclusion',
'To': 'Mrs. Premise',
'Date': '29 July 2001'}, "Hullo, Mrs. Premise!\n")
!
# A folder with many messages
for i in range(5, 101)+range(101, 201, 2):
! writeMessage('wide', i,
{'From': 'nowhere', 'Subject': 'message #%s' % i},
"This is message number %s\n" % i)
!
# A deeply nested folder
def deep(folder, n):
! writeMessage(folder, n,
{'Subject': 'Message %s/%s' % (folder, n) },
"This is message number %s in %s\n" % (n, folder) )
--- 104,125 ----
# An inbox with a couple of messages.
! writeMessage('inbox', 1,
{'From': 'Mrs. Premise',
'To': 'Mrs. Conclusion',
'Date': '18 July 2001'}, "Hullo, Mrs. Conclusion!\n")
! writeMessage('inbox', 2,
{'From': 'Mrs. Conclusion',
'To': 'Mrs. Premise',
'Date': '29 July 2001'}, "Hullo, Mrs. Premise!\n")
!
# A folder with many messages
for i in range(5, 101)+range(101, 201, 2):
! writeMessage('wide', i,
{'From': 'nowhere', 'Subject': 'message #%s' % i},
"This is message number %s\n" % i)
!
# A deeply nested folder
def deep(folder, n):
! writeMessage(folder, n,
{'Subject': 'Message %s/%s' % (folder, n) },
"This is message number %s in %s\n" % (n, folder) )
***************
*** 132,139 ****
deep('deep/f2/f3', 1)
deep('deep/f2/f3', 2)
!
def tearDown(self):
deltree(_mhroot)
!
def test_basic(self):
writeContext('inbox')
--- 132,139 ----
deep('deep/f2/f3', 1)
deep('deep/f2/f3', 2)
!
def tearDown(self):
deltree(_mhroot)
!
def test_basic(self):
writeContext('inbox')
***************
*** 155,165 ****
inbox = mh.openfolder('inbox')
! eq(inbox.getfullname(),
os.path.join(os.path.abspath(_mhpath), 'inbox'))
! eq(inbox.getsequencesfilename(),
os.path.join(os.path.abspath(_mhpath), 'inbox', '.mh_sequences'))
! eq(inbox.getmessagefilename(1),
os.path.join(os.path.abspath(_mhpath), 'inbox', '1'))
!
def test_listfolders(self):
mh = getMH()
--- 155,165 ----
inbox = mh.openfolder('inbox')
! eq(inbox.getfullname(),
os.path.join(os.path.abspath(_mhpath), 'inbox'))
! eq(inbox.getsequencesfilename(),
os.path.join(os.path.abspath(_mhpath), 'inbox', '.mh_sequences'))
! eq(inbox.getmessagefilename(1),
os.path.join(os.path.abspath(_mhpath), 'inbox', '1'))
!
def test_listfolders(self):
mh = getMH()
***************
*** 169,173 ****
folders.sort()
eq(folders, ['deep', 'inbox', 'wide'])
!
folders = mh.listallfolders()
folders.sort()
--- 169,173 ----
folders.sort()
eq(folders, ['deep', 'inbox', 'wide'])
!
folders = mh.listallfolders()
folders.sort()
***************
*** 178,182 ****
folders.sort()
eq(folders, map(normF, ['deep/f1', 'deep/f2']))
!
folders = mh.listallsubfolders('deep')
folders.sort()
--- 178,182 ----
folders.sort()
eq(folders, map(normF, ['deep/f1', 'deep/f2']))
!
folders = mh.listallsubfolders('deep')
folders.sort()
***************
*** 191,195 ****
eq = self.assertEquals
writeCurMessage('wide', 55)
!
f = mh.openfolder('wide')
all = f.listmessages()
--- 191,195 ----
eq = self.assertEquals
writeCurMessage('wide', 55)
!
f = mh.openfolder('wide')
all = f.listmessages()
***************
*** 197,210 ****
eq(f.getcurrent(), 55)
f.setcurrent(99)
! eq(readFile(os.path.join(_mhpath, 'wide', '.mh_sequences')),
'cur: 99\n')
def seqeq(seq, val):
eq(f.parsesequence(seq), val)
!
seqeq('5-55', range(5, 56))
seqeq('90-108', range(90, 101)+range(101, 109, 2))
seqeq('90-108', range(90, 101)+range(101, 109, 2))
!
seqeq('10:10', range(10, 20))
seqeq('10:+10', range(10, 20))
--- 197,210 ----
eq(f.getcurrent(), 55)
f.setcurrent(99)
! eq(readFile(os.path.join(_mhpath, 'wide', '.mh_sequences')),
'cur: 99\n')
def seqeq(seq, val):
eq(f.parsesequence(seq), val)
!
seqeq('5-55', range(5, 56))
seqeq('90-108', range(90, 101)+range(101, 109, 2))
seqeq('90-108', range(90, 101)+range(101, 109, 2))
!
seqeq('10:10', range(10, 20))
seqeq('10:+10', range(10, 20))
***************
*** 250,254 ****
path = os.path.join(_mhpath, "dummy1")
self.assert_(os.path.exists(path))
!
f = mh.openfolder('dummy1')
def create(n):
--- 250,254 ----
path = os.path.join(_mhpath, "dummy1")
self.assert_(os.path.exists(path))
!
f = mh.openfolder('dummy1')
def create(n):
***************
*** 259,263 ****
create(8)
create(9)
!
eq(readFile(f.getmessagefilename(9)),
"From: foo\nSubject: 9\n\nDummy Message 9\n")
--- 259,263 ----
create(8)
create(9)
!
eq(readFile(f.getmessagefilename(9)),
"From: foo\nSubject: 9\n\nDummy Message 9\n")
***************
*** 266,270 ****
files = os.listdir(path)
files.sort()
! eq(files, ['7', '8', '9'])
f.removemessages(['7', '8'])
--- 266,270 ----
files = os.listdir(path)
files.sort()
! eq(files, ['7', '8', '9'])
f.removemessages(['7', '8'])
***************
*** 276,280 ****
create(11)
create(12)
!
mh.makefolder("dummy2")
f2 = mh.openfolder("dummy2")
--- 276,280 ----
create(11)
create(12)
!
mh.makefolder("dummy2")
f2 = mh.openfolder("dummy2")
***************
*** 286,295 ****
eq(readFile(f2.getmessagefilename(3)),
"From: foo\nSubject: 10\n\nDummy Message 10\n")
!
f.copymessage(9, f2, 4)
eq(f.listmessages(), [9, 12])
eq(readFile(f2.getmessagefilename(4)),
"From: foo\nSubject: 9\n\nDummy Message 9\n")
!
f.refilemessages([9, 12], f2)
eq(f.listmessages(), [])
--- 286,295 ----
eq(readFile(f2.getmessagefilename(3)),
"From: foo\nSubject: 10\n\nDummy Message 10\n")
!
f.copymessage(9, f2, 4)
eq(f.listmessages(), [9, 12])
eq(readFile(f2.getmessagefilename(4)),
"From: foo\nSubject: 9\n\nDummy Message 9\n")
!
f.refilemessages([9, 12], f2)
eq(f.listmessages(), [])
***************
*** 307,311 ****
mh = getMH()
eq = self.assertEquals
!
f = mh.openfolder('inbox')
msg = f.openmessage(1)
--- 307,311 ----
mh = getMH()
eq = self.assertEquals
!
f = mh.openfolder('inbox')
msg = f.openmessage(1)
***************
*** 317,329 ****
# mhlib.
lines = sortLines(msg.getheadertext())
! eq(lines, ["Date: 18 July 2001",
"From: Mrs. Premise",
"To: Mrs. Conclusion"])
lines = sortLines(msg.getheadertext(lambda h: len(h)==4))
! eq(lines, ["Date: 18 July 2001",
"From: Mrs. Premise"])
eq(msg.getbodytext(), "Hullo, Mrs. Conclusion!\n\n")
eq(msg.getbodytext(0), "Hullo, Mrs. Conclusion!\n\n")
!
# XXXX there should be a better way to reclaim the file handle
msg.fp.close()
--- 317,329 ----
# mhlib.
lines = sortLines(msg.getheadertext())
! eq(lines, ["Date: 18 July 2001",
"From: Mrs. Premise",
"To: Mrs. Conclusion"])
lines = sortLines(msg.getheadertext(lambda h: len(h)==4))
! eq(lines, ["Date: 18 July 2001",
"From: Mrs. Premise"])
eq(msg.getbodytext(), "Hullo, Mrs. Conclusion!\n\n")
eq(msg.getbodytext(0), "Hullo, Mrs. Conclusion!\n\n")
!
# XXXX there should be a better way to reclaim the file handle
msg.fp.close()
Index: test_pkgimport.py
===================================================================
RCS file: /cvsroot/python/python/dist/src/Lib/test/test_pkgimport.py,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -d -r1.2 -r1.3
*** test_pkgimport.py 2001年08月02日 17:23:11 1.2
--- test_pkgimport.py 2001年08月09日 21:40:30 1.3
***************
*** 44,48 ****
f.write(contents)
f.close()
!
def test_package_import__semantics(self):
--- 44,48 ----
f.write(contents)
f.close()
!
def test_package_import__semantics(self):
Index: test_repr.py
===================================================================
RCS file: /cvsroot/python/python/dist/src/Lib/test/test_repr.py,v
retrieving revision 1.1
retrieving revision 1.2
diff -C2 -d -r1.1 -r1.2
*** test_repr.py 2001年07月19日 22:27:56 1.1
--- test_repr.py 2001年08月09日 21:40:30 1.2
***************
*** 6,10 ****
import unittest
from test_support import run_unittest
! from repr import repr as r # Don't shadow builtin repr
--- 6,10 ----
import unittest
from test_support import run_unittest
! from repr import repr as r # Don't shadow builtin repr
***************
*** 25,29 ****
expected = `s`[:13] + "..." + `s`[-14:]
eq(r(s), expected)
!
eq(r("\"'"), repr("\"'"))
s = "\""*30+"'"*100
--- 25,29 ----
expected = `s`[:13] + "..." + `s`[-14:]
eq(r(s), expected)
!
eq(r("\"'"), repr("\"'"))
s = "\""*30+"'"*100
***************
*** 68,72 ****
i1 = ClassWithRepr("a")
eq(r(i1), repr(i1))
!
i2 = ClassWithRepr("x"*1000)
expected = `i2`[:13] + "..." + `i2`[-14:]
--- 68,72 ----
i1 = ClassWithRepr("a")
eq(r(i1), repr(i1))
!
i2 = ClassWithRepr("x"*1000)
expected = `i2`[:13] + "..." + `i2`[-14:]
- Previous message: [Python-checkins] CVS: python/dist/src/Lib cgi.py,1.65,1.66 cmd.py,1.25,1.26 gzip.py,1.25,1.26 urllib.py,1.129,1.130 urllib2.py,1.17,1.18
- Next message: [Python-checkins] CVS: python/dist/src/Doc/lib libstdtypes.tex,1.52.4.2,1.52.4.3
- Messages sorted by:
[ date ]
[ thread ]
[ subject ]
[ author ]