finite-state-machine
finite-state-machine copied to clipboard
List available transactions given the state of the state machine
1 New Class:
- TransitionMeta which is added to the transition methods .__fsm attribute
2 New StateMachine methods:
- all_transitions, returns list of all Transitions
- available_transitions, returns list of all available Transitions based on state of the StateMachine
At first, I thought this would be way simpler. Let me know if this is not the solution you were looking for!
It looks like pytest still passes, however this is only my second PR - so I would love some feedback!
Codecov Report
Merging #22 into master will decrease coverage by
1.95%
. The diff coverage is77.77%
.
@@ Coverage Diff @@
## master #22 +/- ##
==========================================
- Coverage 96.10% 94.15% -1.96%
==========================================
Files 7 7
Lines 154 171 +17
==========================================
+ Hits 148 161 +13
- Misses 6 10 +4
Impacted Files | Coverage Δ | |
---|---|---|
finite_state_machine/draw_state_diagram.py | 81.81% <ø> (ø) |
|
finite_state_machine/state_machine.py | 95.06% <77.77%> (-4.94%) |
:arrow_down: |
Continue to review full report at Codecov.
Legend - Click here to learn more
Δ = absolute <relative> (impact)
,ø = not affected
,? = missing data
Powered by Codecov. Last update bb96cf3...732e456. Read the comment docs.