示例#1
0
 def test_dirname(self):
     pth = URI("/this/is/a/path")
     self.assertEqual(pth.dirname(), URI("/this/is/a"))
     self.assertEqual(pth.dirname(level=2), URI("/this/is"))
     self.assertEqual(pth.dirname(level=3), URI("/this"))
     self.assertEqual(pth.dirname(level=4), URI("/"))
     self.assertEqual(pth.dirname(level=5), URI("/"))
示例#2
0
 def test_dirname(self):
     pth = URI("/this/is/a/path")
     self.assertEqual(pth.dirname(), URI("/this/is/a"))
     self.assertEqual(pth.dirname(level=2), URI("/this/is"))
     self.assertEqual(pth.dirname(level=3), URI("/this"))
     self.assertEqual(pth.dirname(level=4), URI("/"))
     self.assertEqual(pth.dirname(level=5), URI("/"))
示例#3
0
 def test_root_of_non_existing_dir_exists(self):
     dir_path = URI("memory:///foo")
     assert dir_path.dirname().exists()
示例#4
0
 def test_root_of_non_existing_dir_exists(self):
     dir_path = URI("memory:///foo")
     assert dir_path.dirname().exists()