Skip to content

Commit

Permalink
test
Browse files Browse the repository at this point in the history
  • Loading branch information
poly-rodr committed Sep 24, 2024
1 parent ec990bb commit 53763f3
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 deletions.
1 change: 1 addition & 0 deletions py_clob_client/utilities.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ def parse_raw_orderbook_summary(raw_obs: any) -> OrderBookSummary:
bids=bids,
asks=asks,
hash=raw_obs["hash"],
timestamp=raw_obs["timestamp"],
)

return orderbookSummary
Expand Down
10 changes: 5 additions & 5 deletions tests/test_utilities.py
Original file line number Diff line number Diff line change
Expand Up @@ -109,11 +109,11 @@ def test_generate_orderbook_summary_hash(self):
orderbook_summary = parse_raw_orderbook_summary(raw_obs)
self.assertEqual(
generate_orderbook_summary_hash(orderbook_summary),
"c6a606f8fe8f6e370d8acae9dae11705fa425489",
"a2e42a1dc528c65bb927faef7539ffef1b9484de",
)
self.assertEqual(
orderbook_summary.hash,
"c6a606f8fe8f6e370d8acae9dae11705fa425489",
"a2e42a1dc528c65bb927faef7539ffef1b9484de",
)

raw_obs = {
Expand All @@ -127,18 +127,18 @@ def test_generate_orderbook_summary_hash(self):
{"price": "0.6", "size": "100"},
{"price": "0.7", "size": "100"},
],
"hash": "c6a606f8fe8f6e370d8acae9dae11705fa425489",
"hash": "a2e42a1dc528c65bb927faef7539ffef1b9484de",
"timestamp": "123456789",
}

orderbook_summary = parse_raw_orderbook_summary(raw_obs)
self.assertEqual(
generate_orderbook_summary_hash(orderbook_summary),
"c6a606f8fe8f6e370d8acae9dae11705fa425489",
"a2e42a1dc528c65bb927faef7539ffef1b9484de",
)
self.assertEqual(
orderbook_summary.hash,
"c6a606f8fe8f6e370d8acae9dae11705fa425489",
"a2e42a1dc528c65bb927faef7539ffef1b9484de",
)

raw_obs = {
Expand Down

0 comments on commit 53763f3

Please sign in to comment.