test.generic.test_io module¶
Tests the Input/Output building blocks to prove validity w.r.t. these tests.
Note
The pypdevsbbl.generic.io.Sound block cannot be tested in a unit test,
but it has been checked that the sounds will be played. To test this yourself,
execute the pypdevsbbl.generic.io module.
See also
-
class
test.generic.test_io.StubLogger[source]¶ Bases:
objectHelper class to cheat the usage of an actual logger.
-
class
test.generic.test_io.IOModel(table, block, inp)[source]¶ Bases:
pypdevs.DEVS.CoupledDEVSSimple model constructor for the tests.
Parameters: - table (list) – A list with all events that should happen.
- block – The block to connect to the
pypdevsbbl.generic.generators.TableGenerator. - inp – The input port to connect the generator on.
-
test.generic.test_io.simulate(table, block, inp, tt=None)[source]¶ Simulates the model.
Parameters: - table (list) – A list with all events that should happen.
- block – The block to connect to the
pypdevsbbl.generic.generators.TableGenerator. - inp – The input port to connect the generator on.
- tt (numeric) – The termination time or
Noneif no termination time needs to be set. Defaults toNone.
-
class
test.generic.test_io.TestIO(methodName='runTest')[source]¶ Bases:
unittest.case.TestCase-
test_logger()[source]¶ Tests the
pypdevsbbl.generic.io.Loggerand all its subclasses.
-
test_file_writer()[source]¶ Tests the
pypdevsbbl.generic.io.FileWriter.
-
test_file_reader()[source]¶ Tests the
pypdevsbbl.generic.io.FileReader.
-
test_listener()[source]¶ Tests the
pypdevsbbl.generic.io.Listener.
-