summaryrefslogtreecommitdiffstats
path: root/Lib/test/test_macostools.py
diff options
context:
space:
mode:
authorJack Jansen <jack.jansen@cwi.nl>2003-01-28 23:54:05 (GMT)
committerJack Jansen <jack.jansen@cwi.nl>2003-01-28 23:54:05 (GMT)
commitaddc5859db7e98a8898ae51a4c3ed5ac1a0d081d (patch)
treee089761da50426ee1ef4b87329fec3dfbf163cf7 /Lib/test/test_macostools.py
parent2b88dec606511edb90d3a1efdaec03d19d75ff02 (diff)
downloadcpython-addc5859db7e98a8898ae51a4c3ed5ac1a0d081d.zip
cpython-addc5859db7e98a8898ae51a4c3ed5ac1a0d081d.tar.gz
cpython-addc5859db7e98a8898ae51a4c3ed5ac1a0d081d.tar.bz2
Test aliases too.
Diffstat (limited to 'Lib/test/test_macostools.py')
-rw-r--r--Lib/test/test_macostools.py21
1 files changed, 20 insertions, 1 deletions
diff --git a/Lib/test/test_macostools.py b/Lib/test/test_macostools.py
index 55ca1b2..268d9bb 100644
--- a/Lib/test/test_macostools.py
+++ b/Lib/test/test_macostools.py
@@ -2,9 +2,10 @@
import unittest
import macostools
+import macfs
import MacOS
import os
-import tempfile
+import sys
from test import test_support
TESTFN2 = test_support.TESTFN + '2'
@@ -60,6 +61,24 @@ class TestMacostools(unittest.TestCase):
macostools.copy(test_support.TESTFN, TESTFN2)
self.assertEqual(self.compareData(), '')
+ def test_mkalias(self):
+ try:
+ os.unlink(TESTFN2)
+ except:
+ pass
+ macostools.mkalias(test_support.TESTFN, TESTFN2)
+ fss, _, _ = macfs.ResolveAliasFile(TESTFN2)
+ self.assertEqual(fss.as_pathname(), os.path.abspath(test_support.TESTFN))
+
+ def test_mkalias_relative(self):
+ try:
+ os.unlink(TESTFN2)
+ except:
+ pass
+ macostools.mkalias(test_support.TESTFN, TESTFN2, sys.prefix)
+ fss, _, _ = macfs.ResolveAliasFile(TESTFN2)
+ self.assertEqual(fss.as_pathname(), os.path.abspath(test_support.TESTFN))
+
def test_main():
test_support.run_unittest(TestMacostools)