Пример #1
0
    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!")
Пример #2
0
    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!")
Пример #3
0
    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)
Пример #4
0
    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)
Пример #5
0
 def test_emptyDir(self):
     with namedTemporaryDir() as dirName:
         DOMXML = "algo"
         self.assertEqual(DOMXML, hooks._runHooksDir(DOMXML, dirName))
Пример #6
0
 def test_deviceCustomProperties(self):
     with self._deviceCustomPropertiesTestFile() as dirName:
         result = hooks._runHooksDir("oVirt", dirName, params={"customProperty": " rocks!"})
         self.assertEqual(result, "oVirt rocks!")
Пример #7
0
 def test_emptyDir(self):
     with namedTemporaryDir() as dirName:
         DOMXML = "algo"
         self.assertEqual(DOMXML, hooks._runHooksDir(DOMXML, dirName))
Пример #8
0
 def test_deviceCustomProperties(self):
     with self._deviceCustomPropertiesTestFile() as dirName:
         result = hooks._runHooksDir("oVirt",
                                     dirName,
                                     params={'customProperty': ' rocks!'})
         self.assertEqual(result, "oVirt rocks!")