Commit a555f34c authored by Florent Fourcot's avatar Florent Fourcot

iban-tools: replace print in __main__ with a real test suite

parent 6f9d6c80
......@@ -4,7 +4,8 @@ detailed-errors = 1
with-doctest = 1
with-coverage = 1
where = weboob
tests = weboob.tools.capabilities.bank.transactions,
tests = weboob.tools.capabilities.bank.iban,
weboob.tools.capabilities.bank.transactions,
weboob.tools.capabilities.paste,
weboob.tools.application.formatters.json,
weboob.tools.application.formatters.table,
......
......@@ -91,7 +91,8 @@ def rebuild_rib(rib):
key = find_rib_checksum(rib[:5], rib[5:10], rib[10:21])
return unicode(rib[:21] + ('%02d' % key))
if __name__ == '__main__':
print(rebuild_iban('FR0013048379405300290000355'))
print(rebuild_iban('GB87BARC20658244971655'))
print(rebuild_rib('30003021990005077567600'))
def test():
assert rebuild_iban('FR0013048379405300290000355') == "FR7613048379405300290000355"
assert rebuild_iban('GB87BARC20658244971655') == "GB87BARC20658244971655"
assert rebuild_rib('30003021990005077567600') == "30003021990005077567667"
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment