Commit addc5859 authored by Jack Jansen's avatar Jack Jansen

Test aliases too.

parent 2b88dec6
......@@ -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)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment