예제 #1
0
 def test_fasten_filters_out_stuff(self):
     sys.path.append("foo")
     self.assertIn("foo", sys.path)
     with seatbelt.fasten([lambda path: path != "foo"]):
         self.assertNotIn("foo", sys.path)
     self.assertIn("foo", sys.path)
예제 #2
0
 def test_fasten_gets_rid_of_usr_local_by_default(self):
     sys.path.append("/usr/local/SEATBELT")
     with seatbelt.fasten([lambda path: path.__eq__("foo")]):
         self.assertNotIn("/usr/local/SEATBELT", sys.path)
예제 #3
0
 def test_fasten_restores_sys_path(self):
     orig_path = sys.path[:]
     with seatbelt.fasten():
         pass
     final_path = sys.path[:]
     self.assertEqual(orig_path, final_path)