python-stdnum branch master updated. 1.17-7-g27c7c74
[
Date Prev][
Date Next]
[
Thread Prev][
Thread Next]
python-stdnum branch master updated. 1.17-7-g27c7c74
- From: Commits of the python-stdnum project <python-stdnum-commits [at] lists.arthurdejong.org>
- To: python-stdnum-commits [at] lists.arthurdejong.org
- Reply-to: python-stdnum-users [at] lists.arthurdejong.org, python-stdnum-commits [at] lists.arthurdejong.org
- Subject: python-stdnum branch master updated. 1.17-7-g27c7c74
- Date: Tue, 15 Feb 2022 00:08:37 +0100 (CET)
This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "python-stdnum".
The branch, master has been updated
via 27c7c74dfb5a15038b405d37fd7214b2900ec843 (commit)
via cfc80c874e98f221793d3b312df5b3789fcaeda8 (commit)
from a9039c1a51463a040aad5cce3d8b66cb3d44a542 (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
https://arthurdejong.org/git/python-stdnum/commit/?id=27c7c74dfb5a15038b405d37fd7214b2900ec843
commit 27c7c74dfb5a15038b405d37fd7214b2900ec843
Author: Arthur de Jong <arthur@arthurdejong.org>
Date: Mon Feb 14 23:45:22 2022 +0100
Fix Python 2.7 compatibility of the tests
Fixes a9039c1
diff --git a/stdnum/cfi.py b/stdnum/cfi.py
index b960b69..f4ffeaa 100644
--- a/stdnum/cfi.py
+++ b/stdnum/cfi.py
@@ -35,8 +35,16 @@ More information:
Traceback (most recent call last):
...
InvalidComponent: ...
->>> info('ELNUFR')['Payment status']
-'Fully paid'
+>>> import json
+>>> print(json.dumps(info('ELNUFR'), indent=2, sort_keys=True))
+{
+ "Form": "Registered",
+ "Ownership/transfer/sales restrictions": "Free",
+ "Payment status": "Fully paid",
+ "Voting right": "Non-voting",
+ "category": "Equities",
+ "group": "Limited partnership units"
+}
"""
from stdnum import numdb
diff --git a/tests/test_cfi.doctest b/tests/test_cfi.doctest
index e6513ff..3869835 100644
--- a/tests/test_cfi.doctest
+++ b/tests/test_cfi.doctest
@@ -21,7 +21,7 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
This file contains more detailed doctests for the stdnum.cfi module. It
tries to validate a number of numbers that have been found online.
->>> import pprint
+>>> import json
>>> from stdnum import cfi
>>> from stdnum.exceptions import *
@@ -64,23 +64,34 @@ Most characters can be replaced by an X.
The info function returns useful information.
->>> pprint.pprint(cfi.info('DTFNFR'))
-{'Form': 'Registered',
- 'Guarantee or ranking': 'Senior',
- 'Redemption/reimbursement': 'Fixed maturity',
- 'Type of interest': 'Fixed rate',
- 'category': 'Debt instruments',
- 'group': 'Medium-term notes'}
->>> pprint.pprint(cfi.info('IFXXXP'))
-{'Delivery': 'Physical', 'category': 'Spot', 'group': 'Foreign exchange'}
->>> pprint.pprint(cfi.info('IFXXXX'))
-{'category': 'Spot', 'group': 'Foreign exchange'}
->>> pprint.pprint(cfi.info('DBFNXR'))
-{'Form': 'Registered',
- 'Guarantee or ranking': 'Senior',
- 'Type of interest or cash payment': 'Fixed rate',
- 'category': 'Debt instruments',
- 'group': 'Bonds'}
+>>> print(json.dumps(cfi.info('DTFNFR'), indent=2, sort_keys=True))
+{
+ "Form": "Registered",
+ "Guarantee or ranking": "Senior",
+ "Redemption/reimbursement": "Fixed maturity",
+ "Type of interest": "Fixed rate",
+ "category": "Debt instruments",
+ "group": "Medium-term notes"
+}
+>>> print(json.dumps(cfi.info('IFXXXP'), indent=2, sort_keys=True))
+{
+ "Delivery": "Physical",
+ "category": "Spot",
+ "group": "Foreign exchange"
+}
+>>> print(json.dumps(cfi.info('IFXXXX'), indent=2, sort_keys=True))
+{
+ "category": "Spot",
+ "group": "Foreign exchange"
+}
+>>> print(json.dumps(cfi.info('DBFNXR'), indent=2, sort_keys=True))
+{
+ "Form": "Registered",
+ "Guarantee or ranking": "Senior",
+ "Type of interest or cash payment": "Fixed rate",
+ "category": "Debt instruments",
+ "group": "Bonds"
+}
These should all be valid numbers.
https://arthurdejong.org/git/python-stdnum/commit/?id=cfc80c874e98f221793d3b312df5b3789fcaeda8
commit cfc80c874e98f221793d3b312df5b3789fcaeda8
Author: Arthur de Jong <arthur@arthurdejong.org>
Date: Mon Feb 14 23:38:13 2022 +0100
Support running tests with Python 2.7
When using recent versions of virtualenv this ensures that older
versions of pip and setuptools will be used inside the virtualenvs that
are created by tox.
diff --git a/tox.ini b/tox.ini
index 873bef9..9256613 100644
--- a/tox.ini
+++ b/tox.ini
@@ -8,6 +8,8 @@ deps = nose
commands = nosetests
setenv=
PYTHONWARNINGS=all
+ py27: VIRTUALENV_SETUPTOOLS=43.0.0
+ py27: VIRTUALENV_PIP=19.3.1
[testenv:flake8]
skip_install = true
-----------------------------------------------------------------------
Summary of changes:
stdnum/cfi.py | 12 ++++++++++--
tests/test_cfi.doctest | 47 +++++++++++++++++++++++++++++------------------
tox.ini | 2 ++
3 files changed, 41 insertions(+), 20 deletions(-)
hooks/post-receive
--
python-stdnum
- python-stdnum branch master updated. 1.17-7-g27c7c74,
Commits of the python-stdnum project