-
Notifications
You must be signed in to change notification settings - Fork 0
/
reportGeneratorTest.py
37 lines (28 loc) · 993 Bytes
/
reportGeneratorTest.py
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
import unittest
from reportGenerator import generate_client_report
# test for client report generator
# input client_report = {'A': {'SIA': 2600.0}, 'B': {'SIA': -6200.0}, 'C': {'SIA': 3600.0}, 'D': {}, 'E': {'SIA': 1600.0}}
class TestClientReport(unittest.TestCase):
def test_client_report(self):
client_report = {
'client1': {
'instrument1': 100,
'instrument2': -50
},
'client2': {
'instrument1': 200,
'instrument3': 150
}
}
expected_output = [
['client1', 'instrument1', 100],
['client1', 'instrument2', -50],
['client2', 'instrument1', 200],
['client2', 'instrument3', 150]
]
# Call the function
result = generate_client_report(client_report)
# Assert the output
self.assertEqual(result, expected_output)
if __name__ == '__main__':
unittest.main()