forked from theforage/forage-jpmc-swe-task-1
-
Notifications
You must be signed in to change notification settings - Fork 0
/
0001-Re-add-sample-unit-test.patch
44 lines (41 loc) · 1.62 KB
/
0001-Re-add-sample-unit-test.patch
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
From 879221fec2b863d37d5b493f02a530a8098ef6ef Mon Sep 17 00:00:00 2001
From: Joe Ferrer <[email protected]>
Date: Wed, 1 Mar 2023 00:11:51 +1100
Subject: [PATCH] Re-add sample unit test
---
client_test.py | 25 +++++++++++++++++++++++++
1 file changed, 25 insertions(+)
create mode 100644 client_test.py
diff --git a/client_test.py b/client_test.py
new file mode 100644
index 0000000..af2bf26
--- /dev/null
+++ b/client_test.py
@@ -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()
--
2.45.1.windows.1