Skip to content

Commit

Permalink
Re-add sample unit test
Browse files Browse the repository at this point in the history
  • Loading branch information
jf-forage committed Feb 28, 2023
1 parent 24707a7 commit 879221f
Showing 1 changed file with 25 additions and 0 deletions.
25 changes: 25 additions & 0 deletions client_test.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
import unittest
from client3 import getDataPoint

class ClientTest(unittest.TestCase):
def test_getDataPoint_calculatePrice(self):
quotes = [
{'top_ask': {'price': 121.2, 'size': 36}, 'timestamp': '2019-02-11 22:06:30.572453', 'top_bid': {'price': 120.48, 'size': 109}, 'id': '0.109974697771', 'stock': 'ABC'},
{'top_ask': {'price': 121.68, 'size': 4}, 'timestamp': '2019-02-11 22:06:30.572453', 'top_bid': {'price': 117.87, 'size': 81}, 'id': '0.109974697771', 'stock': 'DEF'}
]
""" ------------ Add the assertion below ------------ """

def test_getDataPoint_calculatePriceBidGreaterThanAsk(self):
quotes = [
{'top_ask': {'price': 119.2, 'size': 36}, 'timestamp': '2019-02-11 22:06:30.572453', 'top_bid': {'price': 120.48, 'size': 109}, 'id': '0.109974697771', 'stock': 'ABC'},
{'top_ask': {'price': 121.68, 'size': 4}, 'timestamp': '2019-02-11 22:06:30.572453', 'top_bid': {'price': 117.87, 'size': 81}, 'id': '0.109974697771', 'stock': 'DEF'}
]
""" ------------ Add the assertion below ------------ """


""" ------------ Add more unit tests ------------ """



if __name__ == '__main__':
unittest.main()

0 comments on commit 879221f

Please sign in to comment.