コード例 #1
0
ファイル: test_ilo.py プロジェクト: mamh-mixed/saltstack-salt
    def test_enable_ssh(self):
        """
        Test if it enable the SSH daemon
        """
        with patch.object(
                ilo,
                "global_settings",
                return_value={
                    "Global Settings": {
                        "SSH_STATUS": {
                            "VALUE": "Y"
                        }
                    }
                },
        ):
            self.assertTrue(ilo.enable_ssh())

        with patch.object(
                ilo,
                "global_settings",
                return_value={
                    "Global Settings": {
                        "SSH_STATUS": {
                            "VALUE": "N"
                        }
                    }
                },
        ):
            with patch.object(ilo,
                              "__execute_cmd",
                              return_value={"Enable SSH": {}}):
                self.assertDictEqual(ilo.enable_ssh(), {"Enable SSH": {}})
コード例 #2
0
ファイル: test_ilo.py プロジェクト: morinap/salt-1
    def test_enable_ssh(self):
        '''
        Test if it enable the SSH daemon
        '''
        with patch.object(ilo,
                          'global_settings',
                          return_value={
                              'Global Settings': {
                                  'SSH_STATUS': {
                                      'VALUE': 'Y'
                                  }
                              }
                          }):
            self.assertTrue(ilo.enable_ssh())

        with patch.object(ilo,
                          'global_settings',
                          return_value={
                              'Global Settings': {
                                  'SSH_STATUS': {
                                      'VALUE': 'N'
                                  }
                              }
                          }):
            with patch.object(ilo,
                              '__execute_cmd',
                              return_value={'Enable SSH': {}}):
                self.assertDictEqual(ilo.enable_ssh(), {'Enable SSH': {}})
コード例 #3
0
ファイル: ilo_test.py プロジェクト: DaveQB/salt
    def test_enable_ssh(self):
        '''
        Test if it enable the SSH daemon
        '''
        with patch.object(ilo, 'global_settings',
                          return_value={'Global Settings': {'SSH_STATUS':
                                                            {'VALUE': 'Y'}}}):
            self.assertTrue(ilo.enable_ssh())

        with patch.object(ilo, 'global_settings',
                          return_value={'Global Settings': {'SSH_STATUS':
                                                            {'VALUE': 'N'}}}):
            with patch.object(ilo, '__execute_cmd',
                              return_value={'Enable SSH': {}}):
                self.assertDictEqual(ilo.enable_ssh(), {'Enable SSH': {}})