Пример #1
0
 def test_check_system_health_pass(self):
     """Validate check_system_health method."""
     self._set_args({"firmware": "test.dlp", "nvsram": "test.dlp"})
     firmware = NetAppESeriesFirmware()
     with patch(self.REQUEST_FUNC, return_value=(200, {
             "successful": True
     })):
         firmware.check_system_health()
Пример #2
0
 def test_check_system_health_fail(self):
     """Validate check_system_health method throws proper exceptions."""
     self._set_args({"firmware": "test.dlp", "nvsram": "test.dlp"})
     firmware = NetAppESeriesFirmware()
     with patch(self.SLEEP_FUNC, return_value=None):
         with self.assertRaisesRegexp(AnsibleFailJson,
                                      "Health check failed!"):
             with patch(self.REQUEST_FUNC, return_value=(404, Exception())):
                 firmware.check_system_health()