diff options
| author | Benjamin Peterson <benjamin@python.org> | 2008-05-12 22:25:16 (GMT) |
|---|---|---|
| committer | Benjamin Peterson <benjamin@python.org> | 2008-05-12 22:25:16 (GMT) |
| commit | 69a07fbd9b2c1e2d203532d4babbc6d874d389ee (patch) | |
| tree | 822d06c6602339d309b30584ca0bfd05f5b56edc /Lib/test/test_applesingle.py | |
| parent | a005b34f14fd4548c84886244b68d2c34e75edbd (diff) | |
| download | cpython-69a07fbd9b2c1e2d203532d4babbc6d874d389ee.zip cpython-69a07fbd9b2c1e2d203532d4babbc6d874d389ee.tar.gz cpython-69a07fbd9b2c1e2d203532d4babbc6d874d389ee.tar.bz2 | |
Remove the Mac modules
Diffstat (limited to 'Lib/test/test_applesingle.py')
| -rw-r--r-- | Lib/test/test_applesingle.py | 71 |
1 files changed, 0 insertions, 71 deletions
diff --git a/Lib/test/test_applesingle.py b/Lib/test/test_applesingle.py deleted file mode 100644 index 9dfcb19..0000000 --- a/Lib/test/test_applesingle.py +++ /dev/null @@ -1,71 +0,0 @@ -# Copyright (C) 2003 Python Software Foundation - -import unittest -import macostools -import Carbon.File -import MacOS -import os -from test import test_support -import struct -import applesingle - -AS_MAGIC=0x00051600 -AS_VERSION=0x00020000 -dataforkdata = b'hello\r\0world\n' -resourceforkdata = b'goodbye\ncruel\0world\r' - -applesingledata = struct.pack(">ll16sh", AS_MAGIC, AS_VERSION, "foo", 2) + \ - struct.pack(">llllll", 1, 50, len(dataforkdata), - 2, 50+len(dataforkdata), len(resourceforkdata)) + \ - dataforkdata + \ - resourceforkdata -TESTFN2 = test_support.TESTFN + '2' - -class TestApplesingle(unittest.TestCase): - - def setUp(self): - fp = open(test_support.TESTFN, 'wb') - fp.write(applesingledata) - fp.close() - - def tearDown(self): - try: - os.unlink(test_support.TESTFN) - except: - pass - try: - os.unlink(TESTFN2) - except: - pass - - def compareData(self, isrf, data): - if isrf: - fp = MacOS.openrf(TESTFN2, '*rb') - else: - fp = open(TESTFN2, 'rb') - filedata = fp.read(1000) - self.assertEqual(data, filedata) - - def test_applesingle(self): - try: - os.unlink(TESTFN2) - except: - pass - applesingle.decode(test_support.TESTFN, TESTFN2) - self.compareData(False, dataforkdata) - self.compareData(True, resourceforkdata) - - def test_applesingle_resonly(self): - try: - os.unlink(TESTFN2) - except: - pass - applesingle.decode(test_support.TESTFN, TESTFN2, resonly=True) - self.compareData(False, resourceforkdata) - -def test_main(): - test_support.run_unittest(TestApplesingle) - - -if __name__ == '__main__': - test_main() |
