Skip to content

Commit 6cdddca

Browse files
authored
Added Docstrings (#32)
* Added Docstrings Fixes #22 Signed-off-by: afro-coder <[email protected]> * Added Docstrings Fixes #22 Signed-off-by: afro-coder <[email protected]> * Updated docstring Fixes #22 Signed-off-by: afro-coder <[email protected]> * Added docstrings This will hopefully fix the mix of tabs and spaces and will pass CI/CD too Signed-off-by: afro-coder <[email protected]> * Added docstrings This will hopefully fix the mix of tabs and spaces and will pass CI/CD too Signed-off-by: afro-coder <[email protected]>
1 parent fc339fd commit 6cdddca

File tree

7 files changed

+13
-0
lines changed

7 files changed

+13
-0
lines changed

src/Action.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
11
class Action:
2+
"""Define Action Class"""
3+
24
def __init__(self, expression: str):
35
self.expression = expression
46

src/Actions.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
11
class Actions:
2+
"""Define and check actions"""
3+
24
def __init__(self, actions=None):
35
if actions is None:
46
actions = []

src/Condition.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
11
class Condition:
2+
"""Define a Condition Class"""
3+
24
def __init__(self, expression: str, result: str):
35
self.expression = expression
46
self.result = result

src/Conditions.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
11
class Conditions:
2+
"""Define Conditions"""
3+
24
def __init__(self, conditions=None):
35
if conditions is None:
46
conditions = []

src/Event.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,8 @@
33

44

55
class Event:
6+
"""Construct an Event class"""
7+
68
def __init__(self, name: str, to_state: str, pre_conditions: Conditions, post_conditions: Conditions, pre_actions: Actions, post_actions: Actions):
79
self.name = name
810
self.to_state = to_state

src/State.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
11
class State:
2+
"""Define the state class"""
3+
24
def __init__(self, name: str, events=None):
35
if events is None:
46
events = {}

tests/testBaseStateMachine.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@ def printTest():
3030

3131

3232
class TestBaseStateMachine(unittest.TestCase):
33+
"""Test state machine using various samples"""
3334

3435
def test1(self):
3536

0 commit comments

Comments
 (0)