예제 #1
0
    def test_get_all(self):
        '''
        Test if it return all installed services. Use the ``limit``
        param to restrict results to services of that type.
        '''
        with patch.object(rh_service, '_upstart_services', self._m_ret()):
            self.assertListEqual(rh_service.get_all('upstart'), RET)

        with patch.object(rh_service, '_sysv_services', self._m_ret()):
            self.assertListEqual(rh_service.get_all('sysvinit'), RET)

            with patch.object(rh_service, '_upstart_services', self._m_lst()):
                self.assertListEqual(rh_service.get_all(), RET)
예제 #2
0
    def test_get_all(self):
        '''
        Test if it return all installed services. Use the ``limit``
        param to restrict results to services of that type.
        '''
        with patch.object(rh_service, '_upstart_services', self._m_ret()):
            self.assertListEqual(rh_service.get_all('upstart'), RET)

        with patch.object(rh_service, '_sysv_services', self._m_ret()):
            self.assertListEqual(rh_service.get_all('sysvinit'), RET)

            with patch.object(rh_service, '_upstart_services', self._m_lst()):
                self.assertListEqual(rh_service.get_all(), RET)
예제 #3
0
    def test_get_all(self):
        """
        Test if it return all installed services. Use the ``limit``
        param to restrict results to services of that type.
        """
        with patch.object(rh_service, "_upstart_services", self._m_ret()):
            self.assertListEqual(rh_service.get_all("upstart"), RET)

        with patch.object(rh_service, "_sysv_services", self._m_ret()):
            self.assertListEqual(rh_service.get_all("sysvinit"), RET)

            with patch.object(rh_service, "_upstart_services", self._m_lst()):
                self.assertListEqual(rh_service.get_all(), RET)