@@ -94,6 +94,7 @@ def test_paypal_extraction(self):
9494
9595 tests = [
9696 {
97+ "name" : "no pp" ,
9798 "transaction" : Transaction (
9899 [],
99100 data = {
@@ -109,6 +110,7 @@ def test_paypal_extraction(self):
109110 },
110111 },
111112 {
113+ "name" : "pp" ,
112114 "transaction" : Transaction (
113115 [],
114116 data = {
@@ -123,12 +125,46 @@ def test_paypal_extraction(self):
123125 "memo" : "PP.0000.PP . GITHUB INC, Ihr Einkauf bei GITHUB INC" ,
124126 },
125127 },
128+ {
129+ "name" : "linebreak" ,
130+ "transaction" : Transaction (
131+ [],
132+ data = {
133+ "date" : date .fromisoformat ("2020-08-18" ),
134+ "applicant_name" : "PayPal (Europe) S.a.r.l. et Cie., S.C.A." ,
135+ "purpose" : "PP.0000.PP . GITHUB INC, Ihr Einkauf be\n i GITHUB INC" ,
136+ "amount" : Amount ("4.99" , "D" ),
137+ },
138+ ),
139+ "expected" : {
140+ "payee_name" : "PAYPAL GITHUB INC" ,
141+ "memo" : "PP.0000.PP . GITHUB INC, Ihr Einkauf be\n i GITHUB INC" ,
142+ },
143+ },
144+ {
145+ "name" : "missing space" ,
146+ "transaction" : Transaction (
147+ [],
148+ data = {
149+ "date" : date .fromisoformat ("2020-08-18" ),
150+ "applicant_name" : "PayPal (Europe) S.a.r.l. et Cie., S.C.A." ,
151+ "purpose" : "PP.0000.PP . GITHUB INC, Ihr Einkauf beiGITHUB INC" ,
152+ "amount" : Amount ("4.99" , "D" ),
153+ },
154+ ),
155+ "expected" : {
156+ "payee_name" : "PAYPAL GITHUB INC" ,
157+ "memo" : "PP.0000.PP . GITHUB INC, Ihr Einkauf beiGITHUB INC" ,
158+ },
159+ },
126160 ]
127161
128162 for test in tests :
129163 transformed = ynab_client .transform_transactions ([test ["transaction" ]])
130164 for key in test ["expected" ]:
131- self .assertEqual (test ["expected" ][key ], transformed [0 ][key ])
165+ self .assertEqual (
166+ test ["expected" ][key ], transformed [0 ][key ], test ["name" ]
167+ )
132168
133169 def test_paypal_applicant_names (self ):
134170 ynab_client = YNABClient ("" , "foo" , "" )
@@ -156,4 +192,3 @@ def test_paypal_applicant_names(self):
156192 ]
157193 )
158194 self .assertEqual ("PAYPAL GITHUB INC" , transformed [0 ]["payee_name" ])
159-
0 commit comments