Add tests for pairlock

This commit is contained in:
Matthias
2020-10-17 11:40:01 +02:00
parent e513871fd5
commit 7caa6cfe31
3 changed files with 60 additions and 12 deletions

View File

@@ -287,15 +287,7 @@ class IStrategy(ABC):
:param until: datetime in UTC until the pair should be blocked from opening new trades.
Needs to be timezone aware `datetime.now(timezone.utc)`
"""
lock = PairLock(
pair=pair,
lock_time=datetime.now(timezone.utc),
lock_end_time=until,
reason=reason,
active=True
)
PairLock.session.add(lock)
PairLock.session.flush()
PairLock.lock_pair(pair, until, reason)
def unlock_pair(self, pair: str) -> None:
"""