コード例 #1
0
ファイル: test_ilo.py プロジェクト: mamh-mixed/saltstack-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": {}})
コード例 #2
0
ファイル: test_ilo.py プロジェクト: morinap/salt-1
    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': {}})