Skip to content

Commit 4cd767c

Browse files
committed
Add test with del
1 parent 72f0fb0 commit 4cd767c

File tree

2 files changed

+18
-1
lines changed

2 files changed

+18
-1
lines changed

CHANGES.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,9 @@
11
## Changelog
22

3-
### 0.3.0
3+
### 0.3.0 (2021-07-16)
44
* Update classifiers to indicate this projects only supports MacOS/Linux
55
* Bugfix: Using less than the minimum number of levels for a checksum with Kraken not raising error correctly
6+
* Update: add del examples to test code
67

78
### 0.2.1 (2021-03-29)
89
* Bugfix: Invalid deallocation of python object

tests/test_orderbook.py

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -193,3 +193,19 @@ def test_l3_orderbook():
193193

194194
for side in raw_dict:
195195
assert raw_dict[side] == ob[side].to_dict()
196+
197+
198+
def test_del():
199+
ob = OrderBook()
200+
201+
ob.bids = {1: 1, 2: 2}
202+
ob.asks = {5: 5, 6: 6, 7: 7}
203+
204+
assert len(ob.bids) == 2
205+
206+
del ob.bids[1]
207+
208+
assert 1 not in ob.bids
209+
assert 2 in ob.bids
210+
assert len(ob.bids) == 1
211+
assert ob.bids.to_dict() == {2: 2}

0 commit comments

Comments
 (0)