summaryrefslogtreecommitdiffstats
path: root/Lib/test/test_posixpath.py
diff options
context:
space:
mode:
Diffstat (limited to 'Lib/test/test_posixpath.py')
-rw-r--r--Lib/test/test_posixpath.py72
1 files changed, 0 insertions, 72 deletions
diff --git a/Lib/test/test_posixpath.py b/Lib/test/test_posixpath.py
index 2d845a8..be0afd0 100644
--- a/Lib/test/test_posixpath.py
+++ b/Lib/test/test_posixpath.py
@@ -136,78 +136,6 @@ class PosixPathTest(unittest.TestCase):
self.assertEqual(posixpath.dirname(b"////foo"), b"////")
self.assertEqual(posixpath.dirname(b"//foo//bar"), b"//foo")
- def test_commonprefix(self):
- self.assertEqual(
- posixpath.commonprefix([]),
- ""
- )
- self.assertEqual(
- posixpath.commonprefix(["/home/swenson/spam", "/home/swen/spam"]),
- "/home/swen"
- )
- self.assertEqual(
- posixpath.commonprefix(["/home/swen/spam", "/home/swen/eggs"]),
- "/home/swen/"
- )
- self.assertEqual(
- posixpath.commonprefix(["/home/swen/spam", "/home/swen/spam"]),
- "/home/swen/spam"
- )
-
- self.assertEqual(
- posixpath.commonprefix([b"/home/swenson/spam", b"/home/swen/spam"]),
- b"/home/swen"
- )
- self.assertEqual(
- posixpath.commonprefix([b"/home/swen/spam", b"/home/swen/eggs"]),
- b"/home/swen/"
- )
- self.assertEqual(
- posixpath.commonprefix([b"/home/swen/spam", b"/home/swen/spam"]),
- b"/home/swen/spam"
- )
-
- testlist = ['', 'abc', 'Xbcd', 'Xb', 'XY', 'abcd', 'aXc', 'abd', 'ab', 'aX', 'abcX']
- for s1 in testlist:
- for s2 in testlist:
- p = posixpath.commonprefix([s1, s2])
- self.assertTrue(s1.startswith(p))
- self.assertTrue(s2.startswith(p))
- if s1 != s2:
- n = len(p)
- self.assertNotEqual(s1[n:n+1], s2[n:n+1])
-
- def test_getsize(self):
- f = open(support.TESTFN, "wb")
- try:
- f.write(b"foo")
- f.close()
- self.assertEqual(posixpath.getsize(support.TESTFN), 3)
- finally:
- if not f.closed:
- f.close()
-
- def test_time(self):
- f = open(support.TESTFN, "wb")
- try:
- f.write(b"foo")
- f.close()
- f = open(support.TESTFN, "ab")
- f.write(b"bar")
- f.close()
- f = open(support.TESTFN, "rb")
- d = f.read()
- f.close()
- self.assertEqual(d, b"foobar")
-
- self.assertLessEqual(
- posixpath.getctime(support.TESTFN),
- posixpath.getmtime(support.TESTFN)
- )
- finally:
- if not f.closed:
- f.close()
-
def test_islink(self):
self.assertIs(posixpath.islink(support.TESTFN + "1"), False)
f = open(support.TESTFN + "1", "wb")