Exemplo n.º 1
0
    def test_enable_dhcp(self):
        """
        Test if it enable DHCP
        """
        with patch.object(
                ilo,
                "network",
                return_value={
                    "Network Settings": {
                        "DHCP_ENABLE": {
                            "VALUE": "Y"
                        }
                    }
                },
        ):
            self.assertTrue(ilo.enable_dhcp())

        with patch.object(
                ilo,
                "network",
                return_value={
                    "Network Settings": {
                        "DHCP_ENABLE": {
                            "VALUE": "N"
                        }
                    }
                },
        ):
            with patch.object(ilo,
                              "__execute_cmd",
                              return_value={"Enable DHCP": {}}):
                self.assertDictEqual(ilo.enable_dhcp(), {"Enable DHCP": {}})
Exemplo n.º 2
0
    def test_enable_dhcp(self):
        '''
        Test if it enable DHCP
        '''
        with patch.object(ilo,
                          'network',
                          return_value={
                              'Network Settings': {
                                  'DHCP_ENABLE': {
                                      'VALUE': 'Y'
                                  }
                              }
                          }):
            self.assertTrue(ilo.enable_dhcp())

        with patch.object(ilo,
                          'network',
                          return_value={
                              'Network Settings': {
                                  'DHCP_ENABLE': {
                                      'VALUE': 'N'
                                  }
                              }
                          }):
            with patch.object(ilo,
                              '__execute_cmd',
                              return_value={'Enable DHCP': {}}):
                self.assertDictEqual(ilo.enable_dhcp(), {'Enable DHCP': {}})
Exemplo n.º 3
0
    def test_enable_dhcp(self):
        '''
        Test if it enable DHCP
        '''
        with patch.object(ilo, 'network',
                          return_value={'Network Settings': {'DHCP_ENABLE':
                                                             {'VALUE': 'Y'}}}):
            self.assertTrue(ilo.enable_dhcp())

        with patch.object(ilo, 'network',
                          return_value={'Network Settings': {'DHCP_ENABLE':
                                                             {'VALUE': 'N'}}}):
            with patch.object(ilo, '__execute_cmd',
                              return_value={'Enable DHCP': {}}):
                self.assertDictEqual(ilo.enable_dhcp(), {'Enable DHCP': {}})