mirror of
https://github.com/freqtrade/freqtrade.git
synced 2024-11-10 10:21:59 +00:00
25 lines
685 B
Python
25 lines
685 B
Python
import pytest
|
|
|
|
from freqtrade.persistence import FtNoDBContext, PairLocks, Trade
|
|
|
|
|
|
@pytest.mark.parametrize("timeframe", ["", "5m", "1d"])
|
|
def test_FtNoDBContext(timeframe):
|
|
PairLocks.timeframe = ""
|
|
assert Trade.use_db is True
|
|
assert PairLocks.use_db is True
|
|
assert PairLocks.timeframe == ""
|
|
|
|
with FtNoDBContext(timeframe):
|
|
assert Trade.use_db is False
|
|
assert PairLocks.use_db is False
|
|
assert PairLocks.timeframe == timeframe
|
|
|
|
with FtNoDBContext():
|
|
assert Trade.use_db is False
|
|
assert PairLocks.use_db is False
|
|
assert PairLocks.timeframe == ""
|
|
|
|
assert Trade.use_db is True
|
|
assert PairLocks.use_db is True
|