def test_deviceVmConfProperties(self): with self._deviceCustomPropertiesTestFile() as dirName: vmconf = {'custom': {'customProperty': ' rocks more!'}} result = hooks._runHooksDir("oVirt", dirName, params={'customProperty': ' rocks!'}, vmconf=vmconf) self.assertEqual(result, "oVirt rocks more!")
def test_deviceVmConfProperties(self): with self._deviceCustomPropertiesTestFile() as dirName: vmconf = { 'custom': { 'customProperty': ' rocks more!'}} result = hooks._runHooksDir("oVirt", dirName, params={'customProperty': ' rocks!'}, vmconf=vmconf) self.assertEqual(result, "oVirt rocks more!")
def test_runHooksDir(self): # Add an unicode value to the environment variables # to test whether the utf-8 recoding works properly os.environ["FAKE_GERRIT_USERNAME"] = "******" with self.tempScripts() as (dirName, scripts): Q = 3 DOMXML = "algo" expectedResult = DOMXML for n in range(Q): expectedResult = expectedResult + str(n) res = hooks._runHooksDir(DOMXML, dirName) self.assertEqual(expectedResult, res)
def test_emptyDir(self): with namedTemporaryDir() as dirName: DOMXML = "algo" self.assertEqual(DOMXML, hooks._runHooksDir(DOMXML, dirName))
def test_deviceCustomProperties(self): with self._deviceCustomPropertiesTestFile() as dirName: result = hooks._runHooksDir("oVirt", dirName, params={"customProperty": " rocks!"}) self.assertEqual(result, "oVirt rocks!")
def test_deviceCustomProperties(self): with self._deviceCustomPropertiesTestFile() as dirName: result = hooks._runHooksDir("oVirt", dirName, params={'customProperty': ' rocks!'}) self.assertEqual(result, "oVirt rocks!")