Skip to content

Commit a973cd0

Browse files
committed
add UT for asset level cashflow
1 parent ca92813 commit a973cd0

33 files changed

+62508
-37
lines changed

absbox/local/generic.py

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -98,8 +98,7 @@ def read_pricing(self, pricing):
9898

9999
@staticmethod
100100
def read(resp):
101-
read_paths = {
102-
'fees': ('feeStmt', english_fee_flow_fields_d, "fee")
101+
read_paths = { 'fees': ('feeStmt', english_fee_flow_fields_d, "fee")
103102
, 'accounts': ('accStmt', english_acc_flow_fields_d, "account")
104103
, 'liqProvider': ('liqStmt', english_liq_flow_fields_d, "")
105104
, 'rateSwap': ('rsStmt', english_rs_flow_fields_d, "")
@@ -137,10 +136,13 @@ def read(resp):
137136
output['agg_accounts'] = aggAccs(output['accounts'], 'english')
138137

139138
output['pool'] = {}
140-
output['pool']['oustanding'] = {k:{"flow": readPoolCf(aggFlow['contents'])
141-
,"breakdown": [ readPoolCf(_['contents'])
142-
for _ in breakdownFlows]}
139+
140+
outstanding_pool_flow = {k:{"flow": readPoolCf(aggFlow['contents'])
141+
,"breakdown": [ readPoolCf(_['contents']) for _ in breakdownFlows]}
143142
for k,(aggFlow,breakdownFlows) in resp[4].items()}
143+
output['pool_outstanding'] = {"flow": { k:v['flow'] for k,v in outstanding_pool_flow.items() }
144+
,"breakdown": { k:v['breakdown'] for k,v in outstanding_pool_flow.items() } }
145+
144146
poolMap = deal_content['pool']['contents']
145147

146148

absbox/tests/benchmark/china/resp/test01.out.json

Lines changed: 29 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5251,6 +5251,34 @@
52515251
]
52525252
}
52535253
],
5254-
{}
5254+
{},
5255+
{
5256+
"PoolConsol": [
5257+
{
5258+
"tag": "CashFlowFrame",
5259+
"contents": [
5260+
[
5261+
0,
5262+
"2023-08-31",
5263+
null
5264+
],
5265+
[]
5266+
]
5267+
},
5268+
[
5269+
{
5270+
"tag": "CashFlowFrame",
5271+
"contents": [
5272+
[
5273+
0,
5274+
"2023-08-31",
5275+
null
5276+
],
5277+
[]
5278+
]
5279+
}
5280+
]
5281+
]
5282+
}
52555283
]
52565284
}

absbox/tests/benchmark/china/resp/test02.out.json

Lines changed: 29 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3731,6 +3731,34 @@
37313731
]
37323732
}
37333733
],
3734-
{}
3734+
{},
3735+
{
3736+
"PoolConsol": [
3737+
{
3738+
"tag": "CashFlowFrame",
3739+
"contents": [
3740+
[
3741+
0,
3742+
"2022-12-31",
3743+
null
3744+
],
3745+
[]
3746+
]
3747+
},
3748+
[
3749+
{
3750+
"tag": "CashFlowFrame",
3751+
"contents": [
3752+
[
3753+
0,
3754+
"2022-12-31",
3755+
null
3756+
],
3757+
[]
3758+
]
3759+
}
3760+
]
3761+
]
3762+
}
37353763
]
37363764
}

absbox/tests/benchmark/china/resp/test03.out.json

Lines changed: 29 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2999,6 +2999,34 @@
29992999
]
30003000
}
30013001
],
3002-
{}
3002+
{},
3003+
{
3004+
"PoolConsol": [
3005+
{
3006+
"tag": "CashFlowFrame",
3007+
"contents": [
3008+
[
3009+
0,
3010+
"2022-12-31",
3011+
null
3012+
],
3013+
[]
3014+
]
3015+
},
3016+
[
3017+
{
3018+
"tag": "CashFlowFrame",
3019+
"contents": [
3020+
[
3021+
0,
3022+
"2022-12-31",
3023+
null
3024+
],
3025+
[]
3026+
]
3027+
}
3028+
]
3029+
]
3030+
}
30033031
]
30043032
}

absbox/tests/benchmark/china/resp/test04.out.json

Lines changed: 29 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43219,6 +43219,34 @@
4321943219
]
4322043220
}
4322143221
],
43222-
{}
43222+
{},
43223+
{
43224+
"PoolConsol": [
43225+
{
43226+
"tag": "CashFlowFrame",
43227+
"contents": [
43228+
[
43229+
0,
43230+
"2035-06-30",
43231+
null
43232+
],
43233+
[]
43234+
]
43235+
},
43236+
[
43237+
{
43238+
"tag": "CashFlowFrame",
43239+
"contents": [
43240+
[
43241+
0,
43242+
"2035-06-30",
43243+
null
43244+
],
43245+
[]
43246+
]
43247+
}
43248+
]
43249+
]
43250+
}
4322343251
]
4322443252
}

absbox/tests/benchmark/china/resp/test05.out.json

Lines changed: 40 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55849,6 +55849,45 @@
5584955849
]
5585055850
}
5585155851
],
55852-
{}
55852+
{},
55853+
{
55854+
"PoolConsol": [
55855+
{
55856+
"tag": "CashFlowFrame",
55857+
"contents": [
55858+
[
55859+
0,
55860+
"2038-08-31",
55861+
null
55862+
],
55863+
[]
55864+
]
55865+
},
55866+
[
55867+
{
55868+
"tag": "CashFlowFrame",
55869+
"contents": [
55870+
[
55871+
0,
55872+
"2038-08-31",
55873+
null
55874+
],
55875+
[]
55876+
]
55877+
},
55878+
{
55879+
"tag": "CashFlowFrame",
55880+
"contents": [
55881+
[
55882+
0,
55883+
"2038-08-31",
55884+
null
55885+
],
55886+
[]
55887+
]
55888+
}
55889+
]
55890+
]
55891+
}
5585355892
]
5585455893
}

absbox/tests/benchmark/china/resp/test06.out.json

Lines changed: 29 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28318,6 +28318,34 @@
2831828318
]
2831928319
}
2832028320
],
28321-
{}
28321+
{},
28322+
{
28323+
"PoolConsol": [
28324+
{
28325+
"tag": "CashFlowFrame",
28326+
"contents": [
28327+
[
28328+
0,
28329+
"2030-09-30",
28330+
null
28331+
],
28332+
[]
28333+
]
28334+
},
28335+
[
28336+
{
28337+
"tag": "CashFlowFrame",
28338+
"contents": [
28339+
[
28340+
0,
28341+
"2030-09-30",
28342+
null
28343+
],
28344+
[]
28345+
]
28346+
}
28347+
]
28348+
]
28349+
}
2832228350
]
2832328351
}

0 commit comments

Comments
 (0)