Add a Enum class State that contains Bot running states

This commit is contained in:
Gerald Lonlas 2018-02-03 16:10:58 -08:00
parent 314ab0a84f
commit cf753d5c40
2 changed files with 28 additions and 0 deletions

14
freqtrade/state.py Normal file
View File

@ -0,0 +1,14 @@
# pragma pylint: disable=too-few-public-methods
"""
Bot state constant
"""
import enum
class State(enum.Enum):
"""
Bot running states
"""
RUNNING = 0
STOPPED = 1

View File

@ -0,0 +1,14 @@
"""
Unit test file for constants.py
"""
from freqtrade.state import State
def test_state_object() -> None:
"""
Test the State object has the mandatory states
:return: None
"""
assert hasattr(State, 'RUNNING')
assert hasattr(State, 'STOPPED')