@@ -10,11 +10,14 @@ def test_can_place_orders():
1010 assert len (m .bids ) == 1
1111
1212 assert str (m ) == """Market is: OPEN
13+
1314📊 **TEST Order Book** 📊
14- Bid Orders | Bid Volume | Price | Ask Volume | Ask Orders
15- | | 102 | 7 | 2
16- 1 | 3 | 101 | |
17- """
15+
16+ Bid Orders | Bid Volume | Price | Ask Volume | Ask Orders
17+ | | 102.00 | 5 | 2
18+ 1 | 3 | 101.00 | |
19+
20+ Last Trade: None"""
1821
1922def test_single_match ():
2023 m = Market ("test" )
@@ -46,6 +49,7 @@ def test_multi_match():
4649 assert m .asks [0 ].user_id == 3
4750 assert len (m .trade_history [1 ]) == 1
4851 assert len (m .trade_history [2 ]) == 1
52+ assert 3 not in m .trade_history
4953 assert len (m .trade_history [4 ]) == 2
5054
5155def test_turning ():
@@ -63,11 +67,10 @@ def test_multi_level_clear():
6367 assert m .ask (101 , 1 , 1 , 2 ) is None
6468 assert m .ask (102 , 1 , 1 , 3 ) is None
6569 assert m .ask (103 , 1 , 100 , 4 ) is None
66- assert m .bid (103 , 2 , 10 , 4 ) == """<@2> bought 1 from <@1> at 100
70+ assert m .bid (103 , 2 , 10 , 5 ) == """<@2> bought 1 from <@1> at 100
6771<@2> bought 1 from <@1> at 101
6872<@2> bought 1 from <@1> at 102
69- <@2> bought 7 from <@1> at 103
70- """
73+ <@2> bought 7 from <@1> at 103"""
7174 assert len (m .bids ) == 0
7275 assert len (m .asks ) == 1
7376 assert m .asks [0 ].qty == 93
0 commit comments