Exemplo n.º 1
0
 def test_get_current_scenario(self,
                               loader_mock=None,
                               pod_mock=None,
                               get_mock=None):
     """Test get_current_scenario."""
     self.test_load_config()
     scenario = EnergyRecorder.get_current_scenario()
     self.assertTrue(scenario is not None)
Exemplo n.º 2
0
 def test_current_scenario_exception(self, get_mock=None):
     """Test get current scenario with exception."""
     scenario = EnergyRecorder.get_current_scenario()
     self.assertTrue(scenario is None)
Exemplo n.º 3
0
 def test_current_scenario_api_error(self, get_mock=None):
     """Test get current scenario with API error."""
     CONST.__setattr__('NODE_NAME', 'MOCK_POD')
     self.test_load_config()
     scenario = EnergyRecorder.get_current_scenario()
     self.assertTrue(scenario is None)
Exemplo n.º 4
0
 def test_current_scenario_not_found(self, get_mock=None):
     """Test get current scenario not existing."""
     CONST.__setattr__('NODE_NAME', 'MOCK_POD')
     self.test_load_config()
     scenario = EnergyRecorder.get_current_scenario()
     self.assertTrue(scenario is None)
Exemplo n.º 5
0
 def test_get_current_scenario(self, loader_mock=None, get_mock=None):
     """Test get_current_scenario."""
     CONST.__setattr__('NODE_NAME', 'MOCK_POD')
     self.test_load_config()
     scenario = EnergyRecorder.get_current_scenario()
     self.assertTrue(scenario is not None)
Exemplo n.º 6
0
 def test_current_scenario_api_error(self, get_mock=None):
     """Test get current scenario with API error."""
     os.environ['NODE_NAME'] = 'MOCK_POD'
     self.test_load_config()
     scenario = EnergyRecorder.get_current_scenario()
     self.assertTrue(scenario is None)
Exemplo n.º 7
0
 def test_current_scenario_not_found(self, get_mock=None):
     """Test get current scenario not existing."""
     os.environ['NODE_NAME'] = 'MOCK_POD'
     self.test_load_config()
     scenario = EnergyRecorder.get_current_scenario()
     self.assertTrue(scenario is None)
Exemplo n.º 8
0
 def test_get_current_scenario(self, loader_mock=None, get_mock=None):
     """Test get_current_scenario."""
     os.environ['NODE_NAME'] = 'MOCK_POD'
     self.test_load_config()
     scenario = EnergyRecorder.get_current_scenario()
     self.assertTrue(scenario is not None)