def test_generic_calls(self): """ check whether all generic simulation and postprocessing modules are registered using the general getter call """ # ---------------------- # simulation # solver self.assertEqual([(ODEInt, "ODEInt")], get_registered_modules(SimulationModule, Solver)) # trajectory generators self.assertEqual([(SmoothTransition, "SmoothTransition"), (HarmonicTrajectory, "HarmonicTrajectory"), (Setpoint, "Setpoint") ], get_registered_modules(SimulationModule, Trajectory)) # controllers self.assertEqual([(PIDController, "PIDController")], get_registered_modules(SimulationModule, Controller)) # feedforward self.assertEqual([(PyTrajectory, "PyTrajectory")], get_registered_modules(SimulationModule, Feedforward)) # mixers self.assertEqual([(AdditiveMixer, "AdditiveMixer")], get_registered_modules(SimulationModule, ModelMixer)) self.assertEqual([(AdditiveMixer, "AdditiveMixer")], get_registered_modules(SimulationModule, ObserverMixer)) # limiter self.assertEqual([(ModelInputLimiter, "ModelInputLimiter")], get_registered_modules(SimulationModule, Limiter)) # sensors self.assertEqual([(DeadTimeSensor, "DeadTimeSensor")], get_registered_modules(SimulationModule, Sensor)) # disturbance self.assertEqual([(GaussianNoise, "GaussianNoise")], get_registered_modules(SimulationModule, Disturbance)) # ---------------------- # processing # post-processors self.assertEqual([(StepResponse, "StepResponse"), (PlotAll, "PlotAll") ], get_registered_modules(ProcessingModule, PostProcessingModule))
def test_generic_calls(self): """ check whether all generic simulation and postprocessing modules are registered using the general getter call """ # ---------------------- # simulation # solver self.assertEqual([(ODEInt, "ODEInt")], get_registered_modules(SimulationModule, Solver)) # trajectory generators self.assertEqual([(SmoothTransition, "SmoothTransition"), (HarmonicTrajectory, "HarmonicTrajectory"), (Setpoint, "Setpoint")], get_registered_modules(SimulationModule, Trajectory)) # controllers self.assertEqual([(PIDController, "PIDController")], get_registered_modules(SimulationModule, Controller)) # feedforward self.assertEqual([(PyTrajectory, "PyTrajectory")], get_registered_modules(SimulationModule, Feedforward)) # mixers self.assertEqual([(AdditiveMixer, "AdditiveMixer")], get_registered_modules(SimulationModule, ModelMixer)) self.assertEqual([(AdditiveMixer, "AdditiveMixer")], get_registered_modules(SimulationModule, ObserverMixer)) # limiter self.assertEqual([(ModelInputLimiter, "ModelInputLimiter")], get_registered_modules(SimulationModule, Limiter)) # sensors self.assertEqual([(DeadTimeSensor, "DeadTimeSensor")], get_registered_modules(SimulationModule, Sensor)) # disturbance self.assertEqual([(GaussianNoise, "GaussianNoise")], get_registered_modules(SimulationModule, Disturbance)) # ---------------------- # processing # post-processors self.assertEqual([(StepResponse, "StepResponse"), (PlotAll, "PlotAll")], get_registered_modules(ProcessingModule, PostProcessingModule))
def test_string_call(self): """ the calls should also work with names instead of class objects """ self.assertEqual([(ODEInt, "ODEInt")], get_registered_modules("SimulationModule", "Solver")) self.assertEqual( [(StepResponse, "StepResponse"), (PlotAll, "PlotAll")], get_registered_processing_modules("PostProcessingModule"))
def test_string_call(self): """ the calls should also work with names instead of class objects """ self.assertEqual([(ODEInt, "ODEInt")], get_registered_modules("SimulationModule", "Solver")) self.assertEqual([(StepResponse, "StepResponse"), (PlotAll, "PlotAll") ], get_registered_processing_modules("PostProcessingModule"))