test.generic.test_generators module

Tests the Generator building blocks to prove validity w.r.t. these tests.

Every test will run a PythonPDEVS simulation on a model. This model will afterwards be analyzed against the expected measures. The model has a general shape of

Generator -> TableCollector

class test.generic.test_generators.GenModel(gen=None)[source]

Bases: pypdevs.DEVS.CoupledDEVS

Simple model constructor for the tests.

Parameters:gen – The generator to use.
test.generic.test_generators.simulate(gen, tt=None)[source]

Simulates the model.

Parameters:
  • gen – The generator to use.
  • tt (numeric) – The termination time or None if no termination time needs to be set. Defaults to None.
class test.generic.test_generators.TestGenerators(methodName='runTest')[source]

Bases: unittest.case.TestCase

test_constant()[source]

Tests the pypdevsbbl.generic.generators.ConstantGenerator.

test_function()[source]

Tests the pypdevsbbl.generic.generators.FunctionGenerator.

test_table()[source]

Tests the pypdevsbbl.generic.generators.TableGenerator.

test_table_repeat()[source]

Tests the pypdevsbbl.generic.generators.TableGenerator with a repeat.

test_singlefire()[source]

Tests the pypdevsbbl.generic.generators.SingleFire.

test_bulk()[source]

Tests the pypdevsbbl.generic.generators.BulkGenerator.