From 441abf1e6a15a39f1ef7bf5e4ee2a4a43bff327b Mon Sep 17 00:00:00 2001 From: Joel Grunbaum <joelgrun@gmail.com> Date: Thu, 20 Jan 2022 05:18:00 +0000 Subject: [PATCH] Added names and ready notice --- test.py | 38 ++++++++++++++++++++++++-------------- 1 files changed, 24 insertions(+), 14 deletions(-) diff --git a/test.py b/test.py index ae18f62..f95add8 100644 --- a/test.py +++ b/test.py @@ -6,7 +6,7 @@ import book import protocol -test = False +test = True HOST: str = 'sytev070' if (test): @@ -40,24 +40,34 @@ for message in so_far_today: protocol.handleMessage(bs, message) +def testRecoverBook(bs: {str, book.Book}): + f = open("data.test", "r"); + so_far_today = f.read(); + for message in so_far_today: + protocol.handleMessage(bs, message) + + +message = {"type": "ADD", "product": "F_THS_APP0119T2230", "price": 99.0, + "side": "BUY", "volume": 1} # print(json.dumps(message)) -# print(send(message)) +print(protocol.send(message)) # printRecoveryLog() # logAllIncomingMessages() # print(getInformation()) # wstest() -bs = {} -recoverBook(bs) -print(list(bs)) -for i in bs: - print(bs[i].product) - bs[i].printBook() - print() - if (len(bs[i].askSide.levels) > 0): - print(bs[i].askSide.levels[0]) - if (len(bs[i].bidSide.levels)): - print(bs[i].bidSide.levels[0]) - print() +# bs = {} +# recoverBook(bs) +# testRecoverBook(bs) +# print(list(bs)) +# for i in bs: +# print(bs[i].product) +# bs[i].printBook() +# print() +# if (len(bs[i].askSide.levels) > 0): +# print(bs[i].askSide.levels[0]) +# if (len(bs[i].bidSide.levels)): +# print(bs[i].bidSide.levels[0]) +# print() # book.testBook() -- Gitblit v1.9.3