3.1.3. de_sim.testing package¶
3.1.3.1. Submodules¶
3.1.3.2. de_sim.testing.example_simulation_objects module¶
- Author
Arthur Goldberg <Arthur.Goldberg@mssm.edu>
- Date
2018-02-15
- Copyright
2018-2020, Karr Lab
- License
MIT
-
class
de_sim.testing.example_simulation_objects.
ExampleSimulationObject
(name, **kwargs)[source]¶ Bases:
de_sim.simulation_object.SimulationObject
-
event_handlers
= [(<class 'de_sim.event_message.InitMsg'>, 'handler'), (<class 'de_sim.event_message.Eg1'>, 'handler')][source]¶
-
init_before_run
(*args)[source]¶ Perform initialization before a simulation run
If a simulation object defines init_before_run, it will be called by the simulator just before simulation begins, after all simulation objects have been created and loaded. A simulation object that wishes to schedule initial events for itself or for other objects in the simulation should do so in init_before_run. It can also perform any other initialization in the method.
-
-
class
de_sim.testing.example_simulation_objects.
ImproperlyRegisteredSimulationObject
(name, start_time=0, **kwargs)[source]¶ Bases:
de_sim.simulation_object.SimulationObject
-
init_before_run
(*args)[source]¶ Perform initialization before a simulation run
If a simulation object defines init_before_run, it will be called by the simulator just before simulation begins, after all simulation objects have been created and loaded. A simulation object that wishes to schedule initial events for itself or for other objects in the simulation should do so in init_before_run. It can also perform any other initialization in the method.
-
3.1.3.3. de_sim.testing.mock_simulation_object module¶
An interface for a mock simulation object that can evaluate unit test assertions
- Author
Arthur Goldberg <Arthur.Goldberg@mssm.edu>
- Date
2018-02-06
- Copyright
2018-2020, Karr Lab
- License
MIT
-
class
de_sim.testing.mock_simulation_object.
MockSimulationObject
(name, test_case, **kwargs)[source]¶ Bases:
de_sim.simulation_object.SimulationObject
An object that helps test simulation objects
3.1.3.4. de_sim.testing.some_message_types module¶
3.1.3.5. de_sim.testing.utilities_for_testing module¶
Utilities for testing
- Author
Arthur Goldberg <Arthur.Goldberg@mssm.edu>
- Date
2018-05-16
- Copyright
2018-2020, Karr Lab
- License
MIT
-
de_sim.testing.utilities_for_testing.
make_args
(args_dict, required, options)[source]¶ Make command line argument list, for testing argument parsers
- Parameters
args_dict (
dict
) – argument names and their valuesrequired (
list
) – required command line argumentsoptions (
list
) – optional command line arguments
- Returns
list of strings in command line arguments, as would appear in sys.argv[1:]
- Return type
list