testablestatemachines Package

testablestatemachines Package

This files are part of the ‘symplehfsm’ package.

testablestatemachine Module

..TODO:: write test according to article!!

This is an example following an article of the internet showing how to make a state machine testable. The framework supports testing of state machines.

This is an example state machine following this article:

http://accu.org/index.php/journals/1548

        +----------------------------------------------------------------------------------+
        |                                                                                  |
init -->|                                                                                  |
        |       +-------+  dark/   +---------------------------------------------------+   |
        | *---->| day   |--------->| night                                             |   |
        |   +-->|       |          |                                                   |   |
        |   |   +-------+          |      initial    +--------------+                  |   |
        |   |                      |    *----------->| off          |--+               |   |
        |   |                      |           +---->|              |  |               |   |
        |   |                      |           |     +--------------+  | movement/     |   |
        |   +----------------------|           |                       |  lamp_on      |   |
        |       light/lamp_off     | timeout/  |     +--------------+  |               |   |
        |                          |  lamp_off |     | moving       |<-+               |   |
        |                          |           |  +->|              |                  |   |
        |                          |           |  |  |              |--+               |   |
        |                          |           |  |  +--------------+  |               |   |
        |                          |           |  |                    |               |   |
        |                          |           |  | movement/          |               |   |
        |                          |           |  |                    | no_movement/  |   |
        |                          |           |  |  +--------------+  |   start_timer |   |
        |                          |           |  |  | timing       |  |               |   |
        |                          |           |  +--|              |<-+               |   |
        |                          |           |     |              |                  |   |
        |                          |           +-----|              |                  |   |
        |                          |                 |              |                  |   |
        |                          |                 |              |                  |   |
        |                          |                 +--------------+                  |   |
        |                          |                                                   |   |
        |                          +---------------------------------------------------+   |
        |                                                                                  |
        +----------------------------------------------------------------------------------+
class examples.testablestatemachines.testablestatemachine.Actions[source]

Bases: object

lamp_off()[source]
lamp_on()[source]
start_timer()[source]
class examples.testablestatemachines.testablestatemachine.Events[source]

Bases: object

dark = 0
light = 1
movement = 2
no_movement = 3
timeout = 4
examples.testablestatemachines.testablestatemachine.main()[source]

Table Of Contents

Previous topic

mousefollower Package

Next topic

test Package

This Page