Back to index

python3.2  3.2.2
Public Member Functions
test.test_macpath.MacPathTestCase Class Reference

List of all members.

Public Member Functions

def test_abspath
def test_isabs
def test_split
def test_join
def test_splitext
def test_ismount
def test_normpath

Detailed Description

Definition at line 6 of file test_macpath.py.


Member Function Documentation

Definition at line 8 of file test_macpath.py.

00008 
00009     def test_abspath(self):
00010         self.assertEqual(macpath.abspath("xx:yy"), "xx:yy")

Here is the call graph for this function:

Definition at line 11 of file test_macpath.py.

00011 
00012     def test_isabs(self):
00013         isabs = macpath.isabs
00014         self.assertTrue(isabs("xx:yy"))
00015         self.assertTrue(isabs("xx:yy:"))
00016         self.assertTrue(isabs("xx:"))
00017         self.assertFalse(isabs("foo"))
00018         self.assertFalse(isabs(":foo"))
00019         self.assertFalse(isabs(":foo:bar"))
00020         self.assertFalse(isabs(":foo:bar:"))
00021 
00022         self.assertTrue(isabs(b"xx:yy"))
00023         self.assertTrue(isabs(b"xx:yy:"))
00024         self.assertTrue(isabs(b"xx:"))
00025         self.assertFalse(isabs(b"foo"))
00026         self.assertFalse(isabs(b":foo"))
00027         self.assertFalse(isabs(b":foo:bar"))
00028         self.assertFalse(isabs(b":foo:bar:"))

Here is the call graph for this function:

Definition at line 81 of file test_macpath.py.

00081 
00082     def test_ismount(self):
00083         ismount = macpath.ismount
00084         self.assertEqual(ismount("a:"), True)
00085         self.assertEqual(ismount("a:b"), False)
00086         self.assertEqual(ismount("a:b:"), True)
00087         self.assertEqual(ismount(""), False)
00088         self.assertEqual(ismount(":"), False)
00089 
00090         self.assertEqual(ismount(b"a:"), True)
00091         self.assertEqual(ismount(b"a:b"), False)
00092         self.assertEqual(ismount(b"a:b:"), True)
00093         self.assertEqual(ismount(b""), False)
00094         self.assertEqual(ismount(b":"), False)

Here is the call graph for this function:

Definition at line 49 of file test_macpath.py.

00049 
00050     def test_join(self):
00051         join = macpath.join
00052         self.assertEqual(join('a', 'b'), ':a:b')
00053         self.assertEqual(join('', 'a:b'), 'a:b')
00054         self.assertEqual(join('a:b', 'c'), 'a:b:c')
00055         self.assertEqual(join('a:b', ':c'), 'a:b:c')
00056         self.assertEqual(join('a', ':b', ':c'), ':a:b:c')
00057 
00058         self.assertEqual(join(b'a', b'b'), b':a:b')
00059         self.assertEqual(join(b'', b'a:b'), b'a:b')
00060         self.assertEqual(join(b'a:b', b'c'), b'a:b:c')
00061         self.assertEqual(join(b'a:b', b':c'), b'a:b:c')
00062         self.assertEqual(join(b'a', b':b', b':c'), b':a:b:c')

Here is the call graph for this function:

Definition at line 95 of file test_macpath.py.

00095 
00096     def test_normpath(self):
00097         normpath = macpath.normpath
00098         self.assertEqual(normpath("a:b"), "a:b")
00099         self.assertEqual(normpath("a"), ":a")
00100         self.assertEqual(normpath("a:b::c"), "a:c")
00101         self.assertEqual(normpath("a:b:c:::d"), "a:d")
00102         self.assertRaises(macpath.norm_error, normpath, "a::b")
00103         self.assertRaises(macpath.norm_error, normpath, "a:b:::c")
00104         self.assertEqual(normpath(":"), ":")
00105         self.assertEqual(normpath("a:"), "a:")
00106         self.assertEqual(normpath("a:b:"), "a:b")
00107 
00108         self.assertEqual(normpath(b"a:b"), b"a:b")
00109         self.assertEqual(normpath(b"a"), b":a")
00110         self.assertEqual(normpath(b"a:b::c"), b"a:c")
00111         self.assertEqual(normpath(b"a:b:c:::d"), b"a:d")
00112         self.assertRaises(macpath.norm_error, normpath, b"a::b")
00113         self.assertRaises(macpath.norm_error, normpath, b"a:b:::c")
00114         self.assertEqual(normpath(b":"), b":")
00115         self.assertEqual(normpath(b"a:"), b"a:")
00116         self.assertEqual(normpath(b"a:b:"), b"a:b")
00117 

Here is the call graph for this function:

Definition at line 29 of file test_macpath.py.

00029 
00030     def test_split(self):
00031         split = macpath.split
00032         self.assertEqual(split("foo:bar"),
00033                           ('foo:', 'bar'))
00034         self.assertEqual(split("conky:mountpoint:foo:bar"),
00035                           ('conky:mountpoint:foo', 'bar'))
00036 
00037         self.assertEqual(split(":"), ('', ''))
00038         self.assertEqual(split(":conky:mountpoint:"),
00039                           (':conky:mountpoint', ''))
00040 
00041         self.assertEqual(split(b"foo:bar"),
00042                           (b'foo:', b'bar'))
00043         self.assertEqual(split(b"conky:mountpoint:foo:bar"),
00044                           (b'conky:mountpoint:foo', b'bar'))
00045 
00046         self.assertEqual(split(b":"), (b'', b''))
00047         self.assertEqual(split(b":conky:mountpoint:"),
00048                           (b':conky:mountpoint', b''))

Here is the call graph for this function:

Definition at line 63 of file test_macpath.py.

00063 
00064     def test_splitext(self):
00065         splitext = macpath.splitext
00066         self.assertEqual(splitext(":foo.ext"), (':foo', '.ext'))
00067         self.assertEqual(splitext("foo:foo.ext"), ('foo:foo', '.ext'))
00068         self.assertEqual(splitext(".ext"), ('.ext', ''))
00069         self.assertEqual(splitext("foo.ext:foo"), ('foo.ext:foo', ''))
00070         self.assertEqual(splitext(":foo.ext:"), (':foo.ext:', ''))
00071         self.assertEqual(splitext(""), ('', ''))
00072         self.assertEqual(splitext("foo.bar.ext"), ('foo.bar', '.ext'))
00073 
00074         self.assertEqual(splitext(b":foo.ext"), (b':foo', b'.ext'))
00075         self.assertEqual(splitext(b"foo:foo.ext"), (b'foo:foo', b'.ext'))
00076         self.assertEqual(splitext(b".ext"), (b'.ext', b''))
00077         self.assertEqual(splitext(b"foo.ext:foo"), (b'foo.ext:foo', b''))
00078         self.assertEqual(splitext(b":foo.ext:"), (b':foo.ext:', b''))
00079         self.assertEqual(splitext(b""), (b'', b''))
00080         self.assertEqual(splitext(b"foo.bar.ext"), (b'foo.bar', b'.ext'))

Here is the call graph for this function:


The documentation for this class was generated from the following file: