Add a Enum class State that contains Bot running states
This commit is contained in:
parent
314ab0a84f
commit
cf753d5c40
14
freqtrade/state.py
Normal file
14
freqtrade/state.py
Normal 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
|
14
freqtrade/tests/test_state.py
Normal file
14
freqtrade/tests/test_state.py
Normal 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')
|
Loading…
Reference in New Issue
Block a user