Kaydet (Commit) 6f682be8 authored tarafından Florent Xicluna's avatar Florent Xicluna

Move some tests from test_macpath to test_genericpath.CommonTest

üst fed15766
...@@ -47,6 +47,18 @@ class GenericTest(unittest.TestCase): ...@@ -47,6 +47,18 @@ class GenericTest(unittest.TestCase):
commonprefix(["/home/swen/spam", "/home/swen/spam"]), commonprefix(["/home/swen/spam", "/home/swen/spam"]),
"/home/swen/spam" "/home/swen/spam"
) )
self.assertEqual(
commonprefix(["home:swenson:spam", "home:swen:spam"]),
"home:swen"
)
self.assertEqual(
commonprefix([":home:swen:spam", ":home:swen:eggs"]),
":home:swen:"
)
self.assertEqual(
commonprefix([":home:swen:spam", ":home:swen:spam"]),
":home:swen:spam"
)
testlist = ['', 'abc', 'Xbcd', 'Xb', 'XY', 'abcd', testlist = ['', 'abc', 'Xbcd', 'Xb', 'XY', 'abcd',
'aXc', 'abd', 'ab', 'aX', 'abcX'] 'aXc', 'abd', 'ab', 'aX', 'abcX']
......
...@@ -18,16 +18,6 @@ class MacPathTestCase(unittest.TestCase): ...@@ -18,16 +18,6 @@ class MacPathTestCase(unittest.TestCase):
self.assertFalse(isabs(":foo:bar")) self.assertFalse(isabs(":foo:bar"))
self.assertFalse(isabs(":foo:bar:")) self.assertFalse(isabs(":foo:bar:"))
def test_commonprefix(self):
commonprefix = macpath.commonprefix
self.assertEqual(commonprefix(["home:swenson:spam", "home:swen:spam"]),
"home:swen")
self.assertEqual(commonprefix([":home:swen:spam", ":home:swen:eggs"]),
":home:swen:")
self.assertEqual(commonprefix([":home:swen:spam", ":home:swen:spam"]),
":home:swen:spam")
def test_split(self): def test_split(self):
split = macpath.split split = macpath.split
self.assertEqual(split("foo:bar"), self.assertEqual(split("foo:bar"),
......
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