Exemple #1
0
 def test_path_remove_prefix(self):
     p = Path('/this/is/a/path/with/a/prefix')
     self.assertTrue(p.is_prefix('/this/is/a/path'))
     p.remove_prefix('/this/is/a/path')
     self.assertEqual(p.to_string(), '/with/a/prefix')
Exemple #2
0
 def test_path_prefix(self):
     p = Path('/this/is/a/path/with/a/prefix')
     self.assertTrue(p.is_prefix('/this/is/a/path'))
     self.assertFalse(p.is_prefix('/that/is/a/path'))