示例#1
0
 def test_stop_error(self, delete_mock=None):
     """EnergyRecorder.stop method (method error)."""
     self.test_load_config()
     self.assertFalse(EnergyRecorder.stop())
     delete_mock.assert_called_once_with(
         EnergyRecorder.energy_recorder_api["uri"],
         auth=EnergyRecorder.energy_recorder_api["auth"],
         headers=self.request_headers)
示例#2
0
 def test_stop(self, delete_mock=None):
     """EnergyRecorder.stop method (regular case)."""
     self.test_load_config()
     self.assertTrue(EnergyRecorder.stop())
     delete_mock.assert_called_once_with(
         EnergyRecorder.energy_recorder_api["uri"],
         auth=EnergyRecorder.energy_recorder_api["auth"],
         headers=self.request_headers,
         timeout=EnergyRecorder.CONNECTION_TIMEOUT)