Brett Cannon | b47243a | 2003-06-16 21:54:50 +0000 | [diff] [blame] | 1 | import unittest |
Florent Xicluna | dc1531c | 2010-03-06 18:07:18 +0000 | [diff] [blame] | 2 | from test import test_support, test_genericpath |
Ezio Melotti | 9e9af21 | 2010-02-20 22:34:21 +0000 | [diff] [blame] | 3 | |
Brett Cannon | b47243a | 2003-06-16 21:54:50 +0000 | [diff] [blame] | 4 | import posixpath, os |
Georg Brandl | b86d3fa | 2010-02-07 12:55:12 +0000 | [diff] [blame] | 5 | from posixpath import realpath, abspath, dirname, basename |
Johannes Gijsbers | 4ec4064 | 2004-08-14 15:01:53 +0000 | [diff] [blame] | 6 | |
| 7 | # An absolute path to a temporary filename for testing. We can't rely on TESTFN |
| 8 | # being an absolute path, so we need this. |
| 9 | |
| 10 | ABSTFN = abspath(test_support.TESTFN) |
Skip Montanaro | e809b00 | 2000-07-12 00:20:08 +0000 | [diff] [blame] | 11 | |
Collin Winter | dbead56 | 2007-03-10 02:23:40 +0000 | [diff] [blame] | 12 | def safe_rmdir(dirname): |
| 13 | try: |
| 14 | os.rmdir(dirname) |
| 15 | except OSError: |
| 16 | pass |
| 17 | |
Brett Cannon | b47243a | 2003-06-16 21:54:50 +0000 | [diff] [blame] | 18 | class PosixPathTest(unittest.TestCase): |
Skip Montanaro | e809b00 | 2000-07-12 00:20:08 +0000 | [diff] [blame] | 19 | |
Collin Winter | dbead56 | 2007-03-10 02:23:40 +0000 | [diff] [blame] | 20 | def setUp(self): |
| 21 | self.tearDown() |
| 22 | |
| 23 | def tearDown(self): |
| 24 | for suffix in ["", "1", "2"]: |
| 25 | test_support.unlink(test_support.TESTFN + suffix) |
| 26 | safe_rmdir(test_support.TESTFN + suffix) |
Tim Peters | ea5962f | 2007-03-12 18:07:52 +0000 | [diff] [blame] | 27 | |
Brett Cannon | b47243a | 2003-06-16 21:54:50 +0000 | [diff] [blame] | 28 | def test_join(self): |
| 29 | self.assertEqual(posixpath.join("/foo", "bar", "/bar", "baz"), "/bar/baz") |
| 30 | self.assertEqual(posixpath.join("/foo", "bar", "baz"), "/foo/bar/baz") |
| 31 | self.assertEqual(posixpath.join("/foo/", "bar/", "baz/"), "/foo/bar/baz/") |
Skip Montanaro | e809b00 | 2000-07-12 00:20:08 +0000 | [diff] [blame] | 32 | |
Brett Cannon | b47243a | 2003-06-16 21:54:50 +0000 | [diff] [blame] | 33 | def test_split(self): |
| 34 | self.assertEqual(posixpath.split("/foo/bar"), ("/foo", "bar")) |
| 35 | self.assertEqual(posixpath.split("/"), ("/", "")) |
| 36 | self.assertEqual(posixpath.split("foo"), ("", "foo")) |
| 37 | self.assertEqual(posixpath.split("////foo"), ("////", "foo")) |
| 38 | self.assertEqual(posixpath.split("//foo//bar"), ("//foo", "bar")) |
| 39 | |
Martin v. Löwis | 05c075d | 2007-03-07 11:04:33 +0000 | [diff] [blame] | 40 | def splitextTest(self, path, filename, ext): |
| 41 | self.assertEqual(posixpath.splitext(path), (filename, ext)) |
| 42 | self.assertEqual(posixpath.splitext("/" + path), ("/" + filename, ext)) |
| 43 | self.assertEqual(posixpath.splitext("abc/" + path), ("abc/" + filename, ext)) |
| 44 | self.assertEqual(posixpath.splitext("abc.def/" + path), ("abc.def/" + filename, ext)) |
| 45 | self.assertEqual(posixpath.splitext("/abc.def/" + path), ("/abc.def/" + filename, ext)) |
| 46 | self.assertEqual(posixpath.splitext(path + "/"), (filename + ext + "/", "")) |
Brett Cannon | b47243a | 2003-06-16 21:54:50 +0000 | [diff] [blame] | 47 | |
Martin v. Löwis | 05c075d | 2007-03-07 11:04:33 +0000 | [diff] [blame] | 48 | def test_splitext(self): |
| 49 | self.splitextTest("foo.bar", "foo", ".bar") |
| 50 | self.splitextTest("foo.boo.bar", "foo.boo", ".bar") |
| 51 | self.splitextTest("foo.boo.biff.bar", "foo.boo.biff", ".bar") |
| 52 | self.splitextTest(".csh.rc", ".csh", ".rc") |
| 53 | self.splitextTest("nodots", "nodots", "") |
| 54 | self.splitextTest(".cshrc", ".cshrc", "") |
| 55 | self.splitextTest("...manydots", "...manydots", "") |
| 56 | self.splitextTest("...manydots.ext", "...manydots", ".ext") |
| 57 | self.splitextTest(".", ".", "") |
| 58 | self.splitextTest("..", "..", "") |
| 59 | self.splitextTest("........", "........", "") |
| 60 | self.splitextTest("", "", "") |
Brett Cannon | b47243a | 2003-06-16 21:54:50 +0000 | [diff] [blame] | 61 | |
| 62 | def test_isabs(self): |
| 63 | self.assertIs(posixpath.isabs(""), False) |
| 64 | self.assertIs(posixpath.isabs("/"), True) |
| 65 | self.assertIs(posixpath.isabs("/foo"), True) |
| 66 | self.assertIs(posixpath.isabs("/foo/bar"), True) |
| 67 | self.assertIs(posixpath.isabs("foo/bar"), False) |
| 68 | |
Brett Cannon | b47243a | 2003-06-16 21:54:50 +0000 | [diff] [blame] | 69 | def test_basename(self): |
| 70 | self.assertEqual(posixpath.basename("/foo/bar"), "bar") |
| 71 | self.assertEqual(posixpath.basename("/"), "") |
| 72 | self.assertEqual(posixpath.basename("foo"), "foo") |
| 73 | self.assertEqual(posixpath.basename("////foo"), "foo") |
| 74 | self.assertEqual(posixpath.basename("//foo//bar"), "bar") |
| 75 | |
Brett Cannon | b47243a | 2003-06-16 21:54:50 +0000 | [diff] [blame] | 76 | def test_dirname(self): |
| 77 | self.assertEqual(posixpath.dirname("/foo/bar"), "/foo") |
| 78 | self.assertEqual(posixpath.dirname("/"), "/") |
| 79 | self.assertEqual(posixpath.dirname("foo"), "") |
| 80 | self.assertEqual(posixpath.dirname("////foo"), "////") |
| 81 | self.assertEqual(posixpath.dirname("//foo//bar"), "//foo") |
| 82 | |
Tim Peters | ea5962f | 2007-03-12 18:07:52 +0000 | [diff] [blame] | 83 | def test_islink(self): |
Brett Cannon | b47243a | 2003-06-16 21:54:50 +0000 | [diff] [blame] | 84 | self.assertIs(posixpath.islink(test_support.TESTFN + "1"), False) |
| 85 | f = open(test_support.TESTFN + "1", "wb") |
| 86 | try: |
| 87 | f.write("foo") |
| 88 | f.close() |
| 89 | self.assertIs(posixpath.islink(test_support.TESTFN + "1"), False) |
| 90 | if hasattr(os, "symlink"): |
| 91 | os.symlink(test_support.TESTFN + "1", test_support.TESTFN + "2") |
| 92 | self.assertIs(posixpath.islink(test_support.TESTFN + "2"), True) |
| 93 | os.remove(test_support.TESTFN + "1") |
| 94 | self.assertIs(posixpath.islink(test_support.TESTFN + "2"), True) |
| 95 | self.assertIs(posixpath.exists(test_support.TESTFN + "2"), False) |
Johannes Gijsbers | ae882f7 | 2004-08-30 10:19:56 +0000 | [diff] [blame] | 96 | self.assertIs(posixpath.lexists(test_support.TESTFN + "2"), True) |
Brett Cannon | b47243a | 2003-06-16 21:54:50 +0000 | [diff] [blame] | 97 | finally: |
| 98 | if not f.close(): |
| 99 | f.close() |
Brett Cannon | b47243a | 2003-06-16 21:54:50 +0000 | [diff] [blame] | 100 | |
Collin Winter | dbead56 | 2007-03-10 02:23:40 +0000 | [diff] [blame] | 101 | def test_samefile(self): |
| 102 | f = open(test_support.TESTFN + "1", "wb") |
| 103 | try: |
| 104 | f.write("foo") |
| 105 | f.close() |
| 106 | self.assertIs( |
| 107 | posixpath.samefile( |
| 108 | test_support.TESTFN + "1", |
| 109 | test_support.TESTFN + "1" |
| 110 | ), |
| 111 | True |
| 112 | ) |
| 113 | # If we don't have links, assume that os.stat doesn't return resonable |
| 114 | # inode information and thus, that samefile() doesn't work |
| 115 | if hasattr(os, "symlink"): |
| 116 | os.symlink( |
| 117 | test_support.TESTFN + "1", |
| 118 | test_support.TESTFN + "2" |
| 119 | ) |
| 120 | self.assertIs( |
| 121 | posixpath.samefile( |
| 122 | test_support.TESTFN + "1", |
| 123 | test_support.TESTFN + "2" |
| 124 | ), |
| 125 | True |
| 126 | ) |
| 127 | os.remove(test_support.TESTFN + "2") |
| 128 | f = open(test_support.TESTFN + "2", "wb") |
| 129 | f.write("bar") |
Brett Cannon | b47243a | 2003-06-16 21:54:50 +0000 | [diff] [blame] | 130 | f.close() |
| 131 | self.assertIs( |
| 132 | posixpath.samefile( |
| 133 | test_support.TESTFN + "1", |
Brett Cannon | b47243a | 2003-06-16 21:54:50 +0000 | [diff] [blame] | 134 | test_support.TESTFN + "2" |
Collin Winter | dbead56 | 2007-03-10 02:23:40 +0000 | [diff] [blame] | 135 | ), |
| 136 | False |
| 137 | ) |
| 138 | finally: |
| 139 | if not f.close(): |
| 140 | f.close() |
Brett Cannon | b47243a | 2003-06-16 21:54:50 +0000 | [diff] [blame] | 141 | |
Brett Cannon | b47243a | 2003-06-16 21:54:50 +0000 | [diff] [blame] | 142 | def test_samestat(self): |
| 143 | f = open(test_support.TESTFN + "1", "wb") |
| 144 | try: |
| 145 | f.write("foo") |
| 146 | f.close() |
| 147 | self.assertIs( |
| 148 | posixpath.samestat( |
| 149 | os.stat(test_support.TESTFN + "1"), |
| 150 | os.stat(test_support.TESTFN + "1") |
| 151 | ), |
| 152 | True |
| 153 | ) |
Tim Peters | 478c105 | 2003-06-29 05:46:54 +0000 | [diff] [blame] | 154 | # If we don't have links, assume that os.stat() doesn't return resonable |
Brett Cannon | b47243a | 2003-06-16 21:54:50 +0000 | [diff] [blame] | 155 | # inode information and thus, that samefile() doesn't work |
| 156 | if hasattr(os, "symlink"): |
| 157 | if hasattr(os, "symlink"): |
| 158 | os.symlink(test_support.TESTFN + "1", test_support.TESTFN + "2") |
| 159 | self.assertIs( |
| 160 | posixpath.samestat( |
| 161 | os.stat(test_support.TESTFN + "1"), |
| 162 | os.stat(test_support.TESTFN + "2") |
| 163 | ), |
| 164 | True |
| 165 | ) |
| 166 | os.remove(test_support.TESTFN + "2") |
| 167 | f = open(test_support.TESTFN + "2", "wb") |
| 168 | f.write("bar") |
| 169 | f.close() |
| 170 | self.assertIs( |
| 171 | posixpath.samestat( |
| 172 | os.stat(test_support.TESTFN + "1"), |
| 173 | os.stat(test_support.TESTFN + "2") |
| 174 | ), |
| 175 | False |
| 176 | ) |
| 177 | finally: |
| 178 | if not f.close(): |
| 179 | f.close() |
Brett Cannon | b47243a | 2003-06-16 21:54:50 +0000 | [diff] [blame] | 180 | |
Brett Cannon | b47243a | 2003-06-16 21:54:50 +0000 | [diff] [blame] | 181 | def test_ismount(self): |
| 182 | self.assertIs(posixpath.ismount("/"), True) |
| 183 | |
Brett Cannon | b47243a | 2003-06-16 21:54:50 +0000 | [diff] [blame] | 184 | def test_expanduser(self): |
| 185 | self.assertEqual(posixpath.expanduser("foo"), "foo") |
Brett Cannon | b47243a | 2003-06-16 21:54:50 +0000 | [diff] [blame] | 186 | try: |
| 187 | import pwd |
| 188 | except ImportError: |
| 189 | pass |
| 190 | else: |
Ezio Melotti | b0f5adc | 2010-01-24 16:58:36 +0000 | [diff] [blame] | 191 | self.assertIsInstance(posixpath.expanduser("~/"), basestring) |
Neal Norwitz | 168e73d | 2003-07-01 03:33:31 +0000 | [diff] [blame] | 192 | # if home directory == root directory, this test makes no sense |
| 193 | if posixpath.expanduser("~") != '/': |
| 194 | self.assertEqual( |
| 195 | posixpath.expanduser("~") + "/", |
| 196 | posixpath.expanduser("~/") |
| 197 | ) |
Ezio Melotti | b0f5adc | 2010-01-24 16:58:36 +0000 | [diff] [blame] | 198 | self.assertIsInstance(posixpath.expanduser("~root/"), basestring) |
| 199 | self.assertIsInstance(posixpath.expanduser("~foo/"), basestring) |
Brett Cannon | b47243a | 2003-06-16 21:54:50 +0000 | [diff] [blame] | 200 | |
Walter Dörwald | 4b965f6 | 2009-04-26 20:51:44 +0000 | [diff] [blame] | 201 | with test_support.EnvironmentVarGuard() as env: |
Walter Dörwald | 6733bed | 2009-05-01 17:35:37 +0000 | [diff] [blame] | 202 | env['HOME'] = '/' |
Walter Dörwald | 4b965f6 | 2009-04-26 20:51:44 +0000 | [diff] [blame] | 203 | self.assertEqual(posixpath.expanduser("~"), "/") |
Georg Brandl | 3f0ef20 | 2009-04-05 14:48:49 +0000 | [diff] [blame] | 204 | |
Brett Cannon | b47243a | 2003-06-16 21:54:50 +0000 | [diff] [blame] | 205 | def test_normpath(self): |
| 206 | self.assertEqual(posixpath.normpath(""), ".") |
| 207 | self.assertEqual(posixpath.normpath("/"), "/") |
| 208 | self.assertEqual(posixpath.normpath("//"), "//") |
| 209 | self.assertEqual(posixpath.normpath("///"), "/") |
| 210 | self.assertEqual(posixpath.normpath("///foo/.//bar//"), "/foo/bar") |
| 211 | self.assertEqual(posixpath.normpath("///foo/.//bar//.//..//.//baz"), "/foo/baz") |
| 212 | self.assertEqual(posixpath.normpath("///..//./foo/.//bar"), "/foo/bar") |
| 213 | |
Johannes Gijsbers | 4ec4064 | 2004-08-14 15:01:53 +0000 | [diff] [blame] | 214 | if hasattr(os, "symlink"): |
| 215 | def test_realpath_basic(self): |
| 216 | # Basic operation. |
| 217 | try: |
| 218 | os.symlink(ABSTFN+"1", ABSTFN) |
| 219 | self.assertEqual(realpath(ABSTFN), ABSTFN+"1") |
| 220 | finally: |
Collin Winter | dbead56 | 2007-03-10 02:23:40 +0000 | [diff] [blame] | 221 | test_support.unlink(ABSTFN) |
Tim Peters | a45cacf | 2004-08-20 03:47:14 +0000 | [diff] [blame] | 222 | |
Johannes Gijsbers | 4ec4064 | 2004-08-14 15:01:53 +0000 | [diff] [blame] | 223 | def test_realpath_symlink_loops(self): |
| 224 | # Bug #930024, return the path unchanged if we get into an infinite |
| 225 | # symlink loop. |
| 226 | try: |
| 227 | old_path = abspath('.') |
| 228 | os.symlink(ABSTFN, ABSTFN) |
| 229 | self.assertEqual(realpath(ABSTFN), ABSTFN) |
| 230 | |
| 231 | os.symlink(ABSTFN+"1", ABSTFN+"2") |
| 232 | os.symlink(ABSTFN+"2", ABSTFN+"1") |
| 233 | self.assertEqual(realpath(ABSTFN+"1"), ABSTFN+"1") |
| 234 | self.assertEqual(realpath(ABSTFN+"2"), ABSTFN+"2") |
| 235 | |
| 236 | # Test using relative path as well. |
| 237 | os.chdir(dirname(ABSTFN)) |
| 238 | self.assertEqual(realpath(basename(ABSTFN)), ABSTFN) |
| 239 | finally: |
| 240 | os.chdir(old_path) |
Collin Winter | dbead56 | 2007-03-10 02:23:40 +0000 | [diff] [blame] | 241 | test_support.unlink(ABSTFN) |
| 242 | test_support.unlink(ABSTFN+"1") |
| 243 | test_support.unlink(ABSTFN+"2") |
Johannes Gijsbers | 4ec4064 | 2004-08-14 15:01:53 +0000 | [diff] [blame] | 244 | |
Tim Peters | a45cacf | 2004-08-20 03:47:14 +0000 | [diff] [blame] | 245 | def test_realpath_resolve_parents(self): |
Johannes Gijsbers | 4ec4064 | 2004-08-14 15:01:53 +0000 | [diff] [blame] | 246 | # We also need to resolve any symlinks in the parents of a relative |
| 247 | # path passed to realpath. E.g.: current working directory is |
| 248 | # /usr/doc with 'doc' being a symlink to /usr/share/doc. We call |
| 249 | # realpath("a"). This should return /usr/share/doc/a/. |
| 250 | try: |
| 251 | old_path = abspath('.') |
| 252 | os.mkdir(ABSTFN) |
| 253 | os.mkdir(ABSTFN + "/y") |
| 254 | os.symlink(ABSTFN + "/y", ABSTFN + "/k") |
| 255 | |
| 256 | os.chdir(ABSTFN + "/k") |
| 257 | self.assertEqual(realpath("a"), ABSTFN + "/y/a") |
| 258 | finally: |
| 259 | os.chdir(old_path) |
Collin Winter | dbead56 | 2007-03-10 02:23:40 +0000 | [diff] [blame] | 260 | test_support.unlink(ABSTFN + "/k") |
| 261 | safe_rmdir(ABSTFN + "/y") |
| 262 | safe_rmdir(ABSTFN) |
Johannes Gijsbers | 4ec4064 | 2004-08-14 15:01:53 +0000 | [diff] [blame] | 263 | |
| 264 | def test_realpath_resolve_before_normalizing(self): |
| 265 | # Bug #990669: Symbolic links should be resolved before we |
| 266 | # normalize the path. E.g.: if we have directories 'a', 'k' and 'y' |
| 267 | # in the following hierarchy: |
| 268 | # a/k/y |
| 269 | # |
| 270 | # and a symbolic link 'link-y' pointing to 'y' in directory 'a', |
| 271 | # then realpath("link-y/..") should return 'k', not 'a'. |
| 272 | try: |
| 273 | old_path = abspath('.') |
| 274 | os.mkdir(ABSTFN) |
| 275 | os.mkdir(ABSTFN + "/k") |
| 276 | os.mkdir(ABSTFN + "/k/y") |
| 277 | os.symlink(ABSTFN + "/k/y", ABSTFN + "/link-y") |
| 278 | |
| 279 | # Absolute path. |
| 280 | self.assertEqual(realpath(ABSTFN + "/link-y/.."), ABSTFN + "/k") |
| 281 | # Relative path. |
| 282 | os.chdir(dirname(ABSTFN)) |
Ezio Melotti | e3467d5 | 2010-02-20 09:40:07 +0000 | [diff] [blame] | 283 | self.assertEqual(realpath(basename(ABSTFN) + "/link-y/.."), |
| 284 | ABSTFN + "/k") |
Johannes Gijsbers | 4ec4064 | 2004-08-14 15:01:53 +0000 | [diff] [blame] | 285 | finally: |
| 286 | os.chdir(old_path) |
Collin Winter | dbead56 | 2007-03-10 02:23:40 +0000 | [diff] [blame] | 287 | test_support.unlink(ABSTFN + "/link-y") |
| 288 | safe_rmdir(ABSTFN + "/k/y") |
| 289 | safe_rmdir(ABSTFN + "/k") |
| 290 | safe_rmdir(ABSTFN) |
Tim Peters | 5d36a55 | 2005-06-03 22:40:27 +0000 | [diff] [blame] | 291 | |
Georg Brandl | 268e61c | 2005-06-03 14:28:50 +0000 | [diff] [blame] | 292 | def test_realpath_resolve_first(self): |
| 293 | # Bug #1213894: The first component of the path, if not absolute, |
| 294 | # must be resolved too. |
| 295 | |
| 296 | try: |
| 297 | old_path = abspath('.') |
| 298 | os.mkdir(ABSTFN) |
| 299 | os.mkdir(ABSTFN + "/k") |
| 300 | os.symlink(ABSTFN, ABSTFN + "link") |
| 301 | os.chdir(dirname(ABSTFN)) |
Tim Peters | 5d36a55 | 2005-06-03 22:40:27 +0000 | [diff] [blame] | 302 | |
Georg Brandl | 268e61c | 2005-06-03 14:28:50 +0000 | [diff] [blame] | 303 | base = basename(ABSTFN) |
| 304 | self.assertEqual(realpath(base + "link"), ABSTFN) |
| 305 | self.assertEqual(realpath(base + "link/k"), ABSTFN + "/k") |
| 306 | finally: |
| 307 | os.chdir(old_path) |
Collin Winter | dbead56 | 2007-03-10 02:23:40 +0000 | [diff] [blame] | 308 | test_support.unlink(ABSTFN + "link") |
| 309 | safe_rmdir(ABSTFN + "/k") |
| 310 | safe_rmdir(ABSTFN) |
Brett Cannon | b47243a | 2003-06-16 21:54:50 +0000 | [diff] [blame] | 311 | |
Collin Winter | 6f18774 | 2007-03-16 22:16:08 +0000 | [diff] [blame] | 312 | def test_relpath(self): |
Collin Winter | 75c7eb4 | 2007-03-23 22:24:39 +0000 | [diff] [blame] | 313 | (real_getcwd, os.getcwd) = (os.getcwd, lambda: r"/home/user/bar") |
| 314 | try: |
| 315 | curdir = os.path.split(os.getcwd())[-1] |
| 316 | self.assertRaises(ValueError, posixpath.relpath, "") |
| 317 | self.assertEqual(posixpath.relpath("a"), "a") |
| 318 | self.assertEqual(posixpath.relpath(posixpath.abspath("a")), "a") |
| 319 | self.assertEqual(posixpath.relpath("a/b"), "a/b") |
| 320 | self.assertEqual(posixpath.relpath("../a/b"), "../a/b") |
| 321 | self.assertEqual(posixpath.relpath("a", "../b"), "../"+curdir+"/a") |
| 322 | self.assertEqual(posixpath.relpath("a/b", "../c"), "../"+curdir+"/a/b") |
| 323 | self.assertEqual(posixpath.relpath("a", "b/c"), "../../a") |
Georg Brandl | 183a084 | 2008-01-06 14:27:15 +0000 | [diff] [blame] | 324 | self.assertEqual(posixpath.relpath("a", "a"), ".") |
Collin Winter | 75c7eb4 | 2007-03-23 22:24:39 +0000 | [diff] [blame] | 325 | finally: |
| 326 | os.getcwd = real_getcwd |
Collin Winter | 6f18774 | 2007-03-16 22:16:08 +0000 | [diff] [blame] | 327 | |
Florent Xicluna | dc1531c | 2010-03-06 18:07:18 +0000 | [diff] [blame] | 328 | |
| 329 | class PosixCommonTest(test_genericpath.CommonTest): |
Florent Xicluna | 985478d | 2010-03-06 18:52:52 +0000 | [diff] [blame] | 330 | pathmodule = posixpath |
Florent Xicluna | dc1531c | 2010-03-06 18:07:18 +0000 | [diff] [blame] | 331 | attributes = ['relpath', 'samefile', 'sameopenfile', 'samestat'] |
| 332 | |
| 333 | |
Brett Cannon | b47243a | 2003-06-16 21:54:50 +0000 | [diff] [blame] | 334 | def test_main(): |
Florent Xicluna | dc1531c | 2010-03-06 18:07:18 +0000 | [diff] [blame] | 335 | test_support.run_unittest(PosixPathTest, PosixCommonTest) |
| 336 | |
Brett Cannon | b47243a | 2003-06-16 21:54:50 +0000 | [diff] [blame] | 337 | |
| 338 | if __name__=="__main__": |
| 339 | test_main() |