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.

class test.generic.test_io.StubLogger[source]

Bases: object

Helper class to cheat the usage of an actual logger.

debug(msg)[source]
info(msg)[source]
notice(msg)[source]
warn(msg)[source]
error(msg)[source]
critical(msg)[source]
alert(msg)[source]
emerg(msg)[source]
class test.generic.test_io.IOModel(table, block, inp)[source]

Bases: pypdevs.DEVS.CoupledDEVS

Simple model constructor for the tests.

Parameters:
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 None if no termination time needs to be set. Defaults to None.
class test.generic.test_io.TestIO(methodName='runTest')[source]

Bases: unittest.case.TestCase

setUp()[source]
test_logger()[source]

Tests the pypdevsbbl.generic.io.Logger and 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.