@@ -21,7 +21,7 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
21
21
This file contains more detailed doctests for the stdnum.cfi module. It
22
22
tries to validate a number of numbers that have been found online.
23
23
24
- >>> import pprint
24
+ >>> import json
25
25
>>> from stdnum import cfi
26
26
>>> from stdnum.exceptions import *
27
27
@@ -64,23 +64,34 @@ Most characters can be replaced by an X.
64
64
65
65
The info function returns useful information.
66
66
67
- >>> pprint.pprint(cfi.info('DTFNFR'))
68
- {'Form': 'Registered',
69
- 'Guarantee or ranking': 'Senior',
70
- 'Redemption/reimbursement': 'Fixed maturity',
71
- 'Type of interest': 'Fixed rate',
72
- 'category': 'Debt instruments',
73
- 'group': 'Medium-term notes'}
74
- >>> pprint.pprint(cfi.info('IFXXXP'))
75
- {'Delivery': 'Physical', 'category': 'Spot', 'group': 'Foreign exchange'}
76
- >>> pprint.pprint(cfi.info('IFXXXX'))
77
- {'category': 'Spot', 'group': 'Foreign exchange'}
78
- >>> pprint.pprint(cfi.info('DBFNXR'))
79
- {'Form': 'Registered',
80
- 'Guarantee or ranking': 'Senior',
81
- 'Type of interest or cash payment': 'Fixed rate',
82
- 'category': 'Debt instruments',
83
- 'group': 'Bonds'}
67
+ >>> print(json.dumps(cfi.info('DTFNFR'), indent=2, sort_keys=True))
68
+ {
69
+ "Form": "Registered",
70
+ "Guarantee or ranking": "Senior",
71
+ "Redemption/reimbursement": "Fixed maturity",
72
+ "Type of interest": "Fixed rate",
73
+ "category": "Debt instruments",
74
+ "group": "Medium-term notes"
75
+ }
76
+ >>> print(json.dumps(cfi.info('IFXXXP'), indent=2, sort_keys=True))
77
+ {
78
+ "Delivery": "Physical",
79
+ "category": "Spot",
80
+ "group": "Foreign exchange"
81
+ }
82
+ >>> print(json.dumps(cfi.info('IFXXXX'), indent=2, sort_keys=True))
83
+ {
84
+ "category": "Spot",
85
+ "group": "Foreign exchange"
86
+ }
87
+ >>> print(json.dumps(cfi.info('DBFNXR'), indent=2, sort_keys=True))
88
+ {
89
+ "Form": "Registered",
90
+ "Guarantee or ranking": "Senior",
91
+ "Type of interest or cash payment": "Fixed rate",
92
+ "category": "Debt instruments",
93
+ "group": "Bonds"
94
+ }
84
95
85
96
86
97
These should all be valid numbers.
0 commit comments