Avoid assertIn
authorKlaus Aehlig <aehlig@google.com>
Tue, 5 May 2015 07:23:23 +0000 (09:23 +0200)
committerKlaus Aehlig <aehlig@google.com>
Tue, 5 May 2015 08:53:28 +0000 (10:53 +0200)
...as we still support python versions older than the introduction
of assertIn.

Signed-off-by: Klaus Aehlig <aehlig@google.com>
Reviewed-by: Petr Pudlak <pudlak@google.com>

test/py/ganeti.backend_unittest.py

index 08b0301..2e33993 100755 (executable)
@@ -975,9 +975,9 @@ class TestOSEnvironment(unittest.TestCase):
   def testParamPresence(self):
     env = self._CreateEnv()
     env_keys = env.keys()
-    self.assertIn("OSP_PUBLIC_PARAM", env)
-    self.assertIn("OSP_PRIVATE_PARAM", env)
-    self.assertIn("OSP_ANOTHER_PRIVATE_PARAM", env)
+    self.assertTrue("OSP_PUBLIC_PARAM" in env)
+    self.assertTrue("OSP_PRIVATE_PARAM" in env)
+    self.assertTrue("OSP_ANOTHER_PRIVATE_PARAM" in env)
     self.assertEqual("public_info", env["OSP_PUBLIC_PARAM"])
     self.assertEqual("private_info", env["OSP_PRIVATE_PARAM"])
     self.assertEqual("more_privacy", env["OSP_ANOTHER_PRIVATE_PARAM"])