Exemplo n.º 1
0
    def test_set_http_port(self):
        """
        Test if it configure the port HTTP should listen on
        """
        with patch.object(
                ilo,
                "global_settings",
                return_value={"Global Settings": {
                    "HTTP_PORT": {
                        "VALUE": 80
                    }
                }},
        ):
            self.assertTrue(ilo.set_http_port())

        with patch.object(
                ilo,
                "global_settings",
                return_value={"Global Settings": {
                    "HTTP_PORT": {
                        "VALUE": 40
                    }
                }},
        ):
            with patch.object(ilo,
                              "__execute_cmd",
                              return_value={"Set HTTP Port": {}}):
                self.assertDictEqual(ilo.set_http_port(),
                                     {"Set HTTP Port": {}})
Exemplo n.º 2
0
    def test_set_http_port(self):
        '''
        Test if it configure the port HTTP should listen on
        '''
        with patch.object(
                ilo,
                'global_settings',
                return_value={'Global Settings': {
                    'HTTP_PORT': {
                        'VALUE': 80
                    }
                }}):
            self.assertTrue(ilo.set_http_port())

        with patch.object(
                ilo,
                'global_settings',
                return_value={'Global Settings': {
                    'HTTP_PORT': {
                        'VALUE': 40
                    }
                }}):
            with patch.object(ilo,
                              '__execute_cmd',
                              return_value={'Set HTTP Port': {}}):
                self.assertDictEqual(ilo.set_http_port(),
                                     {'Set HTTP Port': {}})
Exemplo n.º 3
0
    def test_set_http_port(self):
        '''
        Test if it configure the port HTTP should listen on
        '''
        with patch.object(ilo, 'global_settings',
                          return_value={'Global Settings': {'HTTP_PORT':
                                                            {'VALUE': 80}}}):
            self.assertTrue(ilo.set_http_port())

        with patch.object(ilo, 'global_settings',
                          return_value={'Global Settings': {'HTTP_PORT':
                                                            {'VALUE': 40}}}):
            with patch.object(ilo, '__execute_cmd',
                              return_value={'Set HTTP Port': {}}):
                self.assertDictEqual(ilo.set_http_port(),
                                     {'Set HTTP Port': {}})