示例#1
0
    def test_set_https_port(self):
        """
        Test if it configure the port HTTPS should listen on
        """
        with patch.object(
                ilo,
                "global_settings",
                return_value={
                    "Global Settings": {
                        "HTTP_PORT": {
                            "VALUE": 443
                        }
                    }
                },
        ):
            self.assertTrue(ilo.set_https_port())

        with patch.object(
                ilo,
                "global_settings",
                return_value={"Global Settings": {
                    "HTTP_PORT": {
                        "VALUE": 80
                    }
                }},
        ):
            with patch.object(ilo,
                              "__execute_cmd",
                              return_value={"Set HTTPS Port": {}}):
                self.assertDictEqual(ilo.set_https_port(),
                                     {"Set HTTPS Port": {}})
示例#2
0
    def test_set_https_port(self):
        '''
        Test if it configure the port HTTPS should listen on
        '''
        with patch.object(ilo,
                          'global_settings',
                          return_value={
                              'Global Settings': {
                                  'HTTP_PORT': {
                                      'VALUE': 443
                                  }
                              }
                          }):
            self.assertTrue(ilo.set_https_port())

        with patch.object(
                ilo,
                'global_settings',
                return_value={'Global Settings': {
                    'HTTP_PORT': {
                        'VALUE': 80
                    }
                }}):
            with patch.object(ilo,
                              '__execute_cmd',
                              return_value={'Set HTTPS Port': {}}):
                self.assertDictEqual(ilo.set_https_port(),
                                     {'Set HTTPS Port': {}})
示例#3
0
文件: ilo_test.py 项目: DaveQB/salt
    def test_set_https_port(self):
        '''
        Test if it configure the port HTTPS should listen on
        '''
        with patch.object(ilo, 'global_settings',
                          return_value={'Global Settings': {'HTTP_PORT':
                                                            {'VALUE': 443}}}):
            self.assertTrue(ilo.set_https_port())

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