示例#1
0
 def test_start_error(self, post_mock=None):
     """EnergyRecorder.start method (error in method)."""
     self.test_load_config()
     self.assertFalse(EnergyRecorder.start(self.case_name))
     post_mock.assert_called_once_with(
         EnergyRecorder.energy_recorder_api["uri"],
         auth=EnergyRecorder.energy_recorder_api["auth"],
         data=mock.ANY,
         headers=self.request_headers)
示例#2
0
 def test_start(self, post_mock=None, get_mock=None):
     """EnergyRecorder.start method (regular case)."""
     self.test_load_config()
     self.assertTrue(EnergyRecorder.start(self.case_name))
     post_mock.assert_called_once_with(
         EnergyRecorder.energy_recorder_api["uri"],
         auth=EnergyRecorder.energy_recorder_api["auth"],
         data=mock.ANY,
         headers=self.request_headers,
         timeout=EnergyRecorder.CONNECTION_TIMEOUT)
 def test_start_exception(self, conf_loader_mock=None):
     """EnergyRecorder.start test with exception during execution."""
     start_status = EnergyRecorder.start(CASE_NAME)
     self.assertFalse(start_status)