[Python-checkins] python/dist/src/Lib/plat-mac aepack.py,1.2,1.3
jackjansen@users.sourceforge.net
jackjansen@users.sourceforge.net
Wed, 29 Jan 2003 02:41:20 -0800
Update of /cvsroot/python/python/dist/src/Lib/plat-mac
In directory sc8-pr-cvs1:/tmp/cvs-serv9771
Modified Files:
aepack.py
Log Message:
Moved aepack test code to the test suite.
Index: aepack.py
===================================================================
RCS file: /cvsroot/python/python/dist/src/Lib/plat-mac/aepack.py,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -d -r1.2 -r1.3
*** aepack.py 28 Jan 2003 23:53:40 -0000 1.2
--- aepack.py 29 Jan 2003 10:41:18 -0000 1.3
***************
*** 344,385 ****
newobj.__class__ = classtype
return newobj
-
- def _test():
- """Test program. Pack and unpack various things"""
- objs = [
- 'a string',
- 12,
- 12.0,
- None,
- ['a', 'list', 'of', 'strings'],
- {'key1': 'value1', 'key2':'value2'},
- Carbon.File.FSSpec(os.curdir),
- Carbon.File.FSSpec(os.curdir).NewAliasMinimal(),
- aetypes.Enum('enum'),
- aetypes.Type('type'),
- aetypes.Keyword('kwrd'),
- aetypes.Range(1, 10),
- aetypes.Comparison(1, '< ', 10),
- aetypes.Logical('not ', 1),
- # Cannot do StyledText
- # Cannot do AEText
- aetypes.IntlText(0, 0, 'international text'),
- aetypes.IntlWritingCode(0,0),
- aetypes.QDPoint(50,100),
- aetypes.QDRectangle(50,100,150,200),
- aetypes.RGBColor(0x7000, 0x6000, 0x5000),
- aetypes.Unknown('xxxx', 'unknown type data'),
- aetypes.Character(1),
- aetypes.Character(2, aetypes.Line(2)),
- ]
- for o in objs:
- print 'BEFORE', o, `o`
- packed = pack(o)
- unpacked = unpack(packed)
- print 'AFTER ', unpacked, `unpacked`
- import sys
- sys.exit(1)
-
- if __name__ == '__main__':
- _test()
-
--- 344,345 ----