Skip to content

Commit 799032b

Browse files
committed
Basic tests for utils module.
1 parent 3ca51db commit 799032b

File tree

1 file changed

+19
-0
lines changed

1 file changed

+19
-0
lines changed

tests/test_utils.py

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
import utils
2+
3+
4+
def test_market_open():
5+
"""
6+
Test it twice to use the local cached if the market is open.
7+
"""
8+
market_open = utils.market_open()
9+
if market_open:
10+
assert utils.market_open() # run again using cached
11+
12+
13+
def test_tradable_balance():
14+
assert utils.tradable_balance()
15+
16+
17+
def test_margin_status():
18+
res = utils.account_margin_status()
19+
assert isinstance(res, bool)

0 commit comments

Comments
 (0)