OLD | NEW |
1 #!/usr/bin/env python | 1 #!/usr/bin/env python |
2 # -*- coding: utf-8 -*- | 2 # -*- coding: utf-8 -*- |
3 # | 3 # |
4 # Copyright (c) 2013, Cédric Krier | 4 # Copyright (c) 2013, Cédric Krier |
5 # Copyright (c) 2014, Nicolas Évrard | 5 # Copyright (c) 2014, Nicolas Évrard |
6 # Copyright (c) 2013-2014, B2CK | 6 # Copyright (c) 2013-2014, B2CK |
7 # All rights reserved. | 7 # All rights reserved. |
8 # | 8 # |
9 # Redistribution and use in source and binary forms, with or without | 9 # Redistribution and use in source and binary forms, with or without |
10 # modification, are permitted provided that the following conditions are met: | 10 # modification, are permitted provided that the following conditions are met: |
(...skipping 109 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
120 def test_long_tags(self): | 120 def test_long_tags(self): |
121 self.assertEqual(rabo_description( | 121 self.assertEqual(rabo_description( |
122 '/ORDP//NAME/Doe/REMI//CDTRREFTP//CD/SCOR/ISSR/CUR/CDTRREF/' | 122 '/ORDP//NAME/Doe/REMI//CDTRREFTP//CD/SCOR/ISSR/CUR/CDTRREF/' |
123 '12345' | 123 '12345' |
124 )['cdtrref'], '12345') | 124 )['cdtrref'], '12345') |
125 | 125 |
126 def test_non_rabo(self): | 126 def test_non_rabo(self): |
127 self.assertEqual(rabo_description('foo'), {}) | 127 self.assertEqual(rabo_description('foo'), {}) |
128 self.assertEqual(rabo_description('/FOO/BAR/NAME/'), {}) | 128 self.assertEqual(rabo_description('/FOO/BAR/NAME/'), {}) |
129 | 129 |
| 130 def test_mixed_tags(self): |
| 131 self.assertEqual( |
| 132 rabo_description( |
| 133 '/EREF/0007301960/ORDP//NAME/Acist Europe B.V./ADDR/' |
| 134 'Heerlen 6422 PH Heerlen NL/REMI//INV/16000291 29.7.2016'), |
| 135 {'eref': '0007301960', 'ordp': '', |
| 136 'name': 'Acist Europe B.V.', |
| 137 'addr': 'Heerlen 6422 PH Heerlen NL', |
| 138 'remi': '/INV/16000291 29.7.2016'}) |
| 139 |
130 | 140 |
131 class TestABNAMRODescription(unittest.TestCase): | 141 class TestABNAMRODescription(unittest.TestCase): |
132 | 142 |
133 def test_account(self): | 143 def test_account(self): |
134 self.assertEqual(abn_amro_description('12.34.56.789 John Doe'), | 144 self.assertEqual(abn_amro_description('12.34.56.789 John Doe'), |
135 {'account': '123456789'}) | 145 {'account': '123456789'}) |
136 | 146 |
137 def test_giro(self): | 147 def test_giro(self): |
138 self.assertEqual(abn_amro_description('GIRO 4090309'), | 148 self.assertEqual(abn_amro_description('GIRO 4090309'), |
139 {'account': '4090309'}) | 149 {'account': '4090309'}) |
(...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
212 | 222 |
213 def test_non_regiobank(self): | 223 def test_non_regiobank(self): |
214 self.assertEqual(regiobank_description('foo'), {}) | 224 self.assertEqual(regiobank_description('foo'), {}) |
215 description = """foo | 225 description = """foo |
216 bar | 226 bar |
217 test""" | 227 test""" |
218 self.assertEqual(regiobank_description(description), {}) | 228 self.assertEqual(regiobank_description(description), {}) |
219 | 229 |
220 if __name__ == '__main__': | 230 if __name__ == '__main__': |
221 unittest.main() | 231 unittest.main() |
OLD | NEW |