# test.generic.test_queues module — Python(P)DEVS-BBL documentation

# 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`.

See also

`pypdevsbbl.generic.queues`

class `test.generic.test_queues.``QModel`(table, queue, qport, cport)

  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)

  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')

  Bases: `unittest.case.TestCase`

  `test_discipline`()

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

  `test_contents`()

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

  `test_reneging`()

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

  `test_overflow`()

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

  `test_retain_individual`()

    Tests the `pypdevsbbl.generic.queues.Retain` block.

  `test_retain_collection`()

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

  `test_advance`()

    Tests the `pypdevsbbl.generic.queues.Advance` block.