summaryrefslogtreecommitdiffstats
path: root/Lib/distutils/tests
diff options
context:
space:
mode:
authorTarek Ziadé <ziade.tarek@gmail.com>2009-05-17 11:14:15 (GMT)
committerTarek Ziadé <ziade.tarek@gmail.com>2009-05-17 11:14:15 (GMT)
commitc81d84ba81650c7070587467c1bf5eaba0cd1a96 (patch)
tree04c9126794c9e38e2655369ebf125f35d0731335 /Lib/distutils/tests
parentd2dd51dae9925f23f8d3353b8e5131955b01fcd3 (diff)
downloadcpython-c81d84ba81650c7070587467c1bf5eaba0cd1a96.zip
cpython-c81d84ba81650c7070587467c1bf5eaba0cd1a96.tar.gz
cpython-c81d84ba81650c7070587467c1bf5eaba0cd1a96.tar.bz2
Merged revisions 72727 via svnmerge from
svn+ssh://pythondev@svn.python.org/python/trunk ........ r72727 | tarek.ziade | 2009-05-17 13:11:57 +0200 (Sun, 17 May 2009) | 1 line removed sys.platform == 'mac' usage in distutils.dir_util ........
Diffstat (limited to 'Lib/distutils/tests')
-rw-r--r--Lib/distutils/tests/test_dir_util.py14
1 files changed, 10 insertions, 4 deletions
diff --git a/Lib/distutils/tests/test_dir_util.py b/Lib/distutils/tests/test_dir_util.py
index bf416b6..9bd6530 100644
--- a/Lib/distutils/tests/test_dir_util.py
+++ b/Lib/distutils/tests/test_dir_util.py
@@ -3,10 +3,8 @@ import unittest
import os
import shutil
-from distutils.dir_util import mkpath
-from distutils.dir_util import remove_tree
-from distutils.dir_util import create_tree
-from distutils.dir_util import copy_tree
+from distutils.dir_util import (mkpath, remove_tree, create_tree, copy_tree,
+ ensure_relative)
from distutils import log
from distutils.tests import support
@@ -85,6 +83,14 @@ class DirUtilTestCase(support.TempdirManager, unittest.TestCase):
remove_tree(self.root_target, verbose=0)
remove_tree(self.target2, verbose=0)
+ def test_ensure_relative(self):
+ if os.sep == '/':
+ self.assertEquals(ensure_relative('/home/foo'), 'home/foo')
+ self.assertEquals(ensure_relative('some/path'), 'some/path')
+ else: # \\
+ self.assertEquals(ensure_relative('c:\\home\\foo'), 'home\\foo')
+ self.assertEquals(ensure_relative('home\\foo'), 'home\\foo')
+
def test_suite():
return unittest.makeSuite(DirUtilTestCase)