test.generic.test_queues module

Tests the Queue 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

TableGenerator -> Queue -> TableCollector

Note

Whereas not all blocks seem to be tested, because the pypdevsbbl.generic.queues.Queue is a coupled DEVS made up of other blocks, all will be tested in general.

As far as the pypdevsbbl.generic.queues.QueueTracker is concerned, the edgecases will not be tested, because it is only meant to be used in as a part of the pypdevsbbl.generic.queues.Queue.

class test.generic.test_queues.QModel(table, queue, qport, cport)[source]

Bases: pypdevs.DEVS.CoupledDEVS

Simple model constructor for the tests.

Parameters:
  • table (list) – A list with all events that should happen.
  • queue – The queue to test.
  • qport – The input port of the queue.
  • cport – The output port of the queue.
test.generic.test_queues.simulate(table, queue, qport=None, cport=None)[source]

Simulates the model.

Parameters:
  • table (list) – A list with all events that should happen.
  • queue – The queue to test.
  • qport – The input port of the queue.
  • cport – The output port of the queue.
class test.generic.test_queues.TestQueue(methodName='runTest')[source]

Bases: unittest.case.TestCase

test_discipline()[source]

Tests the queueing discipline (fc) of the pypdevsbbl.generic.queues.Queue.

test_contents()[source]

Tests the startup contents (contents) of the pypdevsbbl.generic.queues.SimpleQueue.

test_reneging()[source]

Tests the reneging of the pypdevsbbl.generic.queues.Queue.

test_overflow()[source]

Tests the overflow of the pypdevsbbl.generic.queues.Queue.

test_retain_individual()[source]

Tests the pypdevsbbl.generic.queues.Retain block.

test_retain_collection()[source]

Tests the pypdevsbbl.generic.queues.Retain block in collection mode.

test_advance()[source]

Tests the pypdevsbbl.generic.queues.Advance block.