Exemple #1
0
 def test_paths(self):
     # Use os.pathsep so that the test is OS-neutral.
     e = Environment(p=os.pathsep.join(['/a/b', '/c/d/e', '/c/d/f', '/g/h']))
     e.prepend_to_path('p', '/m/n', '/c/d/f')
     self.assertEqual(e.vars.p, os.pathsep.join(['/m/n', '/c/d/f', '/a/b', '/c/d/e', '/g/h']))
     e.remove_from_path('p', '/a/b', '/x/y', '/c/d')
     self.assertEqual(e.vars.p, os.pathsep.join(['/m/n', '/g/h']))
     e.append_to_path('p', '/m/n', '/c/d/f')
     self.assertEqual(e.vars.p, os.pathsep.join(['/m/n', '/g/h', '/c/d/f']))