def testC(self): """environment setting manipulators""" step = WMStep("CoreHelperTest") template = Template() template.coreInstall(step) helper = CoreHelper(step) try: helper.addEnvironmentVariable("Variable1", "Value1") except Exception as ex: msg = "Failed to call CoreHelper.addEnvironmentVariable:\n" msg += str(ex) self.fail(msg) env = helper.environment() self.failUnless(getattr(env.variables, "Variable1", None) != None) self.assertEqual(getattr(env.variables, "Variable1"), "Value1") helper.addEnvironmentVariable("Variable2", "Value2") self.failUnless(getattr(env.variables, "Variable2", None) != None) self.assertEqual(getattr(env.variables, "Variable2"), "Value2") try: helper.addEnvironmentPath("Path1", "Entry1") helper.addEnvironmentPath("Path1", "Entry2") helper.addEnvironmentPath("Path1", "Entry3") except Exception as ex: msg = "Failed to call CoreHelper.addEnvironmentPath:\n" msg += str(ex) self.fail(msg) path1 = getattr(env.paths, "Path1", None) self.failUnless(path1 != None) self.assertEqual(path1, ['Entry1', 'Entry2', 'Entry3'])
def testC(self): """environment setting manipulators""" step = WMStep("CoreHelperTest") template = Template() template.coreInstall(step) helper = CoreHelper(step) try: helper.addEnvironmentVariable("Variable1", "Value1") except Exception, ex: msg = "Failed to call CoreHelper.addEnvironmentVariable:\n" msg += str(ex) self.fail(msg)