-
Notifications
You must be signed in to change notification settings - Fork 0
/
bonus-task.patch
47 lines (40 loc) · 1.33 KB
/
bonus-task.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
44
45
46
From 2abd7ef460ee18856f3307ca4381e268402fa96e Mon Sep 17 00:00:00 2001
From: sumit budhiraja <[email protected]>
Date: Wed, 13 May 2020 13:37:17 +0000
Subject: [PATCH] Create Patch File
---
client_test.py | 23 +++++++++++++++++++++++
1 file changed, 23 insertions(+)
diff --git a/client_test.py b/client_test.py
index 4817cff..3eef3c6 100644
--- a/client_test.py
+++ b/client_test.py
@@ -21,7 +21,30 @@ class ClientTest(unittest.TestCase):
self.assertEqual(getDataPoint(quote),{quote['stock'],quote['top_bid']['price'],quote['top_ask']['price'],{quote['top_bid']['price']+quote['top_ask']['price']}/2})
""" ------------ Add more unit tests ------------ """
+def test_getRatio_priceBZero(self):
+ price_a = 119.2
+ price_b = 0
+ self.assertIsNone(getRatio(price_a, price_b))
+
+def test_getRatio_priceAZero(self):
+ price_a = 0
+ price_b = 121.68
+ self.assertEqual(getRatio(price_a, price_b), 0)
+
+def test_getRatio_greaterThan1(self):
+ price_a = 346.48
+ price_b = 166.39
+ self.assertGreater(getRatio(price_a, price_b), 1)
+def test_getRatio_LessThan1(self):
+ price_a = 166.39
+ price_b = 356.48
+ self.assertLess(getRatio(price_a, price_b), 1)
+
+def test_getRatio_exactlyOne(self):
+ price_a = 356.48
+ price_b = 356.48
+ self.assertEqual(getRatio(price_a, price_b), 1)
if __name__ == '__main__':
--
2.17.1