diff options
author | Brett Cannon <bcannon@gmail.com> | 2007-05-20 23:17:38 (GMT) |
---|---|---|
committer | Brett Cannon <bcannon@gmail.com> | 2007-05-20 23:17:38 (GMT) |
commit | 5e2635103c34ca1d4226f64c84c6bdf54d528d75 (patch) | |
tree | 1da233d88d33946de18f4e696b6c9013ada049ac /Lib/test | |
parent | 7e93587746374693b10b3c8cade7a0bc8c7eb100 (diff) | |
download | cpython-5e2635103c34ca1d4226f64c84c6bdf54d528d75.zip cpython-5e2635103c34ca1d4226f64c84c6bdf54d528d75.tar.gz cpython-5e2635103c34ca1d4226f64c84c6bdf54d528d75.tar.bz2 |
Remove the macfs module. This led to the deprecation of macostools.touched();
it completely relied on macfs and is a no-op on OS X according to code
comments.
Diffstat (limited to 'Lib/test')
-rwxr-xr-x | Lib/test/regrtest.py | 6 | ||||
-rw-r--r-- | Lib/test/test_macfs.py | 78 | ||||
-rw-r--r-- | Lib/test/test_macostools.py | 6 |
3 files changed, 6 insertions, 84 deletions
diff --git a/Lib/test/regrtest.py b/Lib/test/regrtest.py index cba70ed..01484be 100755 --- a/Lib/test/regrtest.py +++ b/Lib/test/regrtest.py @@ -1198,7 +1198,6 @@ _expectations = { test_imgfile test_linuxaudiodev test_locale - test_macfs test_macostools test_nis test_ossaudiodev @@ -1235,7 +1234,6 @@ _expectations = { test_gzip test_imgfile test_linuxaudiodev - test_macfs test_macostools test_nis test_ossaudiodev @@ -1264,7 +1262,6 @@ _expectations = { test_imgfile test_linuxaudiodev test_locale - test_macfs test_macostools test_nis test_normalization @@ -1298,7 +1295,6 @@ _expectations = { test_imgfile test_linuxaudiodev test_locale - test_macfs test_macostools test_nis test_ossaudiodev @@ -1340,7 +1336,7 @@ class _ExpectedSkips: self.expected.add('test_imageop') if not sys.platform in ("mac", "darwin"): - MAC_ONLY = ["test_macostools", "test_macfs", "test_aepack", + MAC_ONLY = ["test_macostools", "test_aepack", "test_plistlib", "test_scriptpackages"] for skip in MAC_ONLY: self.expected.add(skip) diff --git a/Lib/test/test_macfs.py b/Lib/test/test_macfs.py deleted file mode 100644 index 9c0e3a1..0000000 --- a/Lib/test/test_macfs.py +++ /dev/null @@ -1,78 +0,0 @@ -# Copyright (C) 2003 Python Software Foundation - -import unittest -import warnings -warnings.filterwarnings("ignore", "macfs.*", DeprecationWarning, __name__) -import macfs -import os -import sys -import tempfile -from test import test_support - -class TestMacfs(unittest.TestCase): - - def setUp(self): - fp = open(test_support.TESTFN, 'w') - fp.write('hello world\n') - fp.close() - - def tearDown(self): - try: - os.unlink(test_support.TESTFN) - except: - pass - - def test_fsspec(self): - fss = macfs.FSSpec(test_support.TESTFN) - self.assertEqual(os.path.realpath(test_support.TESTFN), fss.as_pathname()) - - def test_fsref(self): - fsr = macfs.FSRef(test_support.TESTFN) - self.assertEqual(os.path.realpath(test_support.TESTFN), fsr.as_pathname()) - - def test_fsref_unicode(self): - if sys.getfilesystemencoding(): - testfn_unicode = unicode(test_support.TESTFN) - fsr = macfs.FSRef(testfn_unicode) - self.assertEqual(os.path.realpath(test_support.TESTFN), fsr.as_pathname()) - - def test_coercion(self): - fss = macfs.FSSpec(test_support.TESTFN) - fsr = macfs.FSRef(test_support.TESTFN) - fss2 = fsr.as_fsspec() - fsr2 = fss.as_fsref() - self.assertEqual(fss.as_pathname(), fss2.as_pathname()) - self.assertEqual(fsr.as_pathname(), fsr2.as_pathname()) - - def test_dates(self): - import time - fss = macfs.FSSpec(test_support.TESTFN) - now = int(time.time()) - fss.SetDates(now, now+1, now+2) - dates = fss.GetDates() - self.assertEqual(dates, (now, now+1, now+2)) - - def test_ctor_type(self): - fss = macfs.FSSpec(test_support.TESTFN) - fss.SetCreatorType('Pyth', 'TEXT') - filecr, filetp = fss.GetCreatorType() - self.assertEqual((filecr, filetp), ('Pyth', 'TEXT')) - - def test_alias(self): - fss = macfs.FSSpec(test_support.TESTFN) - alias = fss.NewAlias() - fss2, changed = alias.Resolve() - self.assertEqual(changed, 0) - self.assertEqual(fss.as_pathname(), fss2.as_pathname()) - - - def test_fss_alias(self): - fss = macfs.FSSpec(test_support.TESTFN) - - -def test_main(): - test_support.run_unittest(TestMacfs) - - -if __name__ == '__main__': - test_main() diff --git a/Lib/test/test_macostools.py b/Lib/test/test_macostools.py index f3292ce..40b690a 100644 --- a/Lib/test/test_macostools.py +++ b/Lib/test/test_macostools.py @@ -51,7 +51,11 @@ class TestMacostools(unittest.TestCase): def test_touched(self): # This really only tests that nothing unforeseen happens. - macostools.touched(test_support.TESTFN) + import warnings + with test_support.guard_warnings_filter(): + warnings.filterwarnings('ignore', 'macostools.touched*', + DeprecationWarning) + macostools.touched(test_support.TESTFN) def test_copy(self): try: |