def test7(self): a = Path('a/b/') self.assertEqual(a.get_pathtoroot(), '../') a = Path(u'a/b/') self.assertEqual(a.get_pathtoroot(), u'../')
def test3(self): a = Path('/a/b') self.assertEqual(a.get_pathtoroot(), '../') a = Path(u'/a/b') self.assertEqual(a.get_pathtoroot(), u'../')
def test5(self): a = Path('/a/very/long/path') self.assertEqual(a.get_pathtoroot(), '../../../') a = Path(u'/a/very/long/path') self.assertEqual(a.get_pathtoroot(), u'../../../')
def test2(self): a = Path('/a/') self.assertEqual(a.get_pathtoroot(), '') a = Path(u'/a/') self.assertEqual(a.get_pathtoroot(), u'')