Esempio n. 1
0
 def test_parts(self):
     """Tests parent, ancestor, name, stem, ext."""
     relative = PosixPath(b'directory/users/r\xE9mi/file.txt')
     absolute = PosixPath(u'/some/other/thing.h\xE9h\xE9')
     self.assertEqual(relative.parent.path, b'directory/users/r\xE9mi')
     self.assertEqual(absolute.parent.path, b'/some/other')
     self.assertEqual(absolute.ancestor(10).path, b'/')
     self.assertEqual(relative.name, b'file.txt')
     self.assertEqual(absolute.name, b'thing.h\xC3\xA9h\xC3\xA9')
     self.assertEqual(absolute.unicodename, u'thing.h\xE9h\xE9')
     self.assertEqual(absolute.stem, b'thing')
     self.assertEqual(absolute.ext, b'.h\xC3\xA9h\xC3\xA9')
Esempio n. 2
0
 def test_parts(self):
     """Tests parent, ancestor, name, stem, ext."""
     relative = PosixPath(b'directory/users/r\xE9mi/file.txt')
     absolute = PosixPath(u'/some/other/thing.h\xE9h\xE9')
     self.assertEqual(relative.parent.path,
                      b'directory/users/r\xE9mi')
     self.assertEqual(absolute.parent.path,
                      b'/some/other')
     self.assertEqual(absolute.ancestor(10).path,
                      b'/')
     self.assertEqual(relative.name, b'file.txt')
     self.assertEqual(absolute.name, b'thing.h\xC3\xA9h\xC3\xA9')
     self.assertEqual(absolute.unicodename, u'thing.h\xE9h\xE9')
     self.assertEqual(absolute.stem, b'thing')
     self.assertEqual(absolute.ext, b'.h\xC3\xA9h\xC3\xA9')