@@ -151,9 +151,7 @@ def test_cst01_cbs_ibs_is_tributada_integralmente(self):
151151 xml = self ._serializar_e_assinar ()
152152
153153 # impostoMisto group exists
154- imposto_misto = xml .xpath (
155- "//ns:det/ns:imposto/ns:impostoMisto" , namespaces = self .ns
156- )
154+ imposto_misto = xml .xpath ("//ns:det/ns:imposto/ns:impostoMisto" , namespaces = self .ns )
157155 self .assertEqual (len (imposto_misto ), 1 )
158156
159157 # CBS
@@ -167,14 +165,14 @@ def test_cst01_cbs_ibs_is_tributada_integralmente(self):
167165 )[0 ].text
168166 self .assertEqual (vbc_cbs , "1000.00" )
169167
170- pcbs = xml .xpath (
171- "//ns:det/ns:imposto/ns:impostoMisto/ns:CBS/ns:pCBS" , namespaces = self . ns
172- )[ 0 ].text
168+ pcbs = xml .xpath ("//ns:det/ns:imposto/ns:impostoMisto/ns:CBS/ns:pCBS" , namespaces = self . ns )[
169+ 0
170+ ].text
173171 self .assertEqual (pcbs , "8.8000" )
174172
175- vcbs = xml .xpath (
176- "//ns:det/ns:imposto/ns:impostoMisto/ns:CBS/ns:vCBS" , namespaces = self . ns
177- )[ 0 ].text
173+ vcbs = xml .xpath ("//ns:det/ns:imposto/ns:impostoMisto/ns:CBS/ns:vCBS" , namespaces = self . ns )[
174+ 0
175+ ].text
178176 self .assertEqual (vcbs , "88.00" )
179177
180178 # IBS
@@ -188,14 +186,14 @@ def test_cst01_cbs_ibs_is_tributada_integralmente(self):
188186 )[0 ].text
189187 self .assertEqual (vbc_ibs , "1000.00" )
190188
191- pibs = xml .xpath (
192- "//ns:det/ns:imposto/ns:impostoMisto/ns:IBS/ns:pIBS" , namespaces = self . ns
193- )[ 0 ].text
189+ pibs = xml .xpath ("//ns:det/ns:imposto/ns:impostoMisto/ns:IBS/ns:pIBS" , namespaces = self . ns )[
190+ 0
191+ ].text
194192 self .assertEqual (pibs , "17.7000" )
195193
196- vibs = xml .xpath (
197- "//ns:det/ns:imposto/ns:impostoMisto/ns:IBS/ns:vIBS" , namespaces = self . ns
198- )[ 0 ].text
194+ vibs = xml .xpath ("//ns:det/ns:imposto/ns:impostoMisto/ns:IBS/ns:vIBS" , namespaces = self . ns )[
195+ 0
196+ ].text
199197 self .assertEqual (vibs , "177.00" )
200198
201199 cmun = xml .xpath (
@@ -204,46 +202,38 @@ def test_cst01_cbs_ibs_is_tributada_integralmente(self):
204202 self .assertEqual (cmun , "4118402" )
205203
206204 # IS
207- cst_is = xml .xpath (
208- "//ns:det/ns:imposto/ns:impostoMisto/ns:IS/ns:CST" , namespaces = self . ns
209- )[ 0 ].text
205+ cst_is = xml .xpath ("//ns:det/ns:imposto/ns:impostoMisto/ns:IS/ns:CST" , namespaces = self . ns )[
206+ 0
207+ ].text
210208 self .assertEqual (cst_is , "01" )
211209
212- vbc_is = xml .xpath (
213- "//ns:det/ns:imposto/ns:impostoMisto/ns:IS/ns:vBC" , namespaces = self . ns
214- )[ 0 ].text
210+ vbc_is = xml .xpath ("//ns:det/ns:imposto/ns:impostoMisto/ns:IS/ns:vBC" , namespaces = self . ns )[
211+ 0
212+ ].text
215213 self .assertEqual (vbc_is , "1000.00" )
216214
217- pis_val = xml .xpath (
218- "//ns:det/ns:imposto/ns:impostoMisto/ns:IS/ns:pIS" , namespaces = self . ns
219- )[ 0 ].text
215+ pis_val = xml .xpath ("//ns:det/ns:imposto/ns:impostoMisto/ns:IS/ns:pIS" , namespaces = self . ns )[
216+ 0
217+ ].text
220218 self .assertEqual (pis_val , "1.0000" )
221219
222- vis = xml .xpath (
223- "//ns:det/ns:imposto/ns:impostoMisto/ns:IS/ns:vIS" , namespaces = self . ns
224- )[ 0 ].text
220+ vis = xml .xpath ("//ns:det/ns:imposto/ns:impostoMisto/ns:IS/ns:vIS" , namespaces = self . ns )[
221+ 0
222+ ].text
225223 self .assertEqual (vis , "10.00" )
226224
227225 # Totals
228- vcbs_total = xml .xpath (
229- "//ns:total/ns:ICMSTot/ns:vCBS" , namespaces = self .ns
230- )[0 ].text
226+ vcbs_total = xml .xpath ("//ns:total/ns:ICMSTot/ns:vCBS" , namespaces = self .ns )[0 ].text
231227 self .assertEqual (vcbs_total , "88.00" )
232228
233- vibs_total = xml .xpath (
234- "//ns:total/ns:ICMSTot/ns:vIBS" , namespaces = self .ns
235- )[0 ].text
229+ vibs_total = xml .xpath ("//ns:total/ns:ICMSTot/ns:vIBS" , namespaces = self .ns )[0 ].text
236230 self .assertEqual (vibs_total , "177.00" )
237231
238- vis_total = xml .xpath (
239- "//ns:total/ns:ICMSTot/ns:vIS" , namespaces = self .ns
240- )[0 ].text
232+ vis_total = xml .xpath ("//ns:total/ns:ICMSTot/ns:vIS" , namespaces = self .ns )[0 ].text
241233 self .assertEqual (vis_total , "10.00" )
242234
243235 # vNF includes IBS/CBS/IS
244- vnf = xml .xpath (
245- "//ns:total/ns:ICMSTot/ns:vNF" , namespaces = self .ns
246- )[0 ].text
236+ vnf = xml .xpath ("//ns:total/ns:ICMSTot/ns:vNF" , namespaces = self .ns )[0 ].text
247237 self .assertEqual (vnf , "1275.00" )
248238
249239 # ------------------------------------------------------------------
@@ -293,9 +283,7 @@ def test_cst03_isencao_sem_valores(self):
293283 xml = self ._serializar_e_assinar ()
294284
295285 # impostoMisto group exists (CBS + IBS present even if exempt)
296- imposto_misto = xml .xpath (
297- "//ns:det/ns:imposto/ns:impostoMisto" , namespaces = self .ns
298- )
286+ imposto_misto = xml .xpath ("//ns:det/ns:imposto/ns:impostoMisto" , namespaces = self .ns )
299287 self .assertEqual (len (imposto_misto ), 1 )
300288
301289 # CBS CST present, no value tags
@@ -304,9 +292,7 @@ def test_cst03_isencao_sem_valores(self):
304292 )[0 ].text
305293 self .assertEqual (cst_cbs , "03" )
306294
307- vbc_cbs = xml .xpath (
308- "//ns:det/ns:imposto/ns:impostoMisto/ns:CBS/ns:vBC" , namespaces = self .ns
309- )
295+ vbc_cbs = xml .xpath ("//ns:det/ns:imposto/ns:impostoMisto/ns:CBS/ns:vBC" , namespaces = self .ns )
310296 self .assertEqual (len (vbc_cbs ), 0 ) # No vBC for CST 03
311297
312298 # IBS CST present, no value tags
@@ -315,21 +301,15 @@ def test_cst03_isencao_sem_valores(self):
315301 )[0 ].text
316302 self .assertEqual (cst_ibs , "03" )
317303
318- vbc_ibs = xml .xpath (
319- "//ns:det/ns:imposto/ns:impostoMisto/ns:IBS/ns:vBC" , namespaces = self .ns
320- )
304+ vbc_ibs = xml .xpath ("//ns:det/ns:imposto/ns:impostoMisto/ns:IBS/ns:vBC" , namespaces = self .ns )
321305 self .assertEqual (len (vbc_ibs ), 0 )
322306
323307 # No IS group
324- is_group = xml .xpath (
325- "//ns:det/ns:imposto/ns:impostoMisto/ns:IS" , namespaces = self .ns
326- )
308+ is_group = xml .xpath ("//ns:det/ns:imposto/ns:impostoMisto/ns:IS" , namespaces = self .ns )
327309 self .assertEqual (len (is_group ), 0 )
328310
329311 # No totals for CBS/IBS/IS (all zero)
330- vcbs_total = xml .xpath (
331- "//ns:total/ns:ICMSTot/ns:vCBS" , namespaces = self .ns
332- )
312+ vcbs_total = xml .xpath ("//ns:total/ns:ICMSTot/ns:vCBS" , namespaces = self .ns )
333313 self .assertEqual (len (vcbs_total ), 0 )
334314
335315 # ------------------------------------------------------------------
@@ -374,20 +354,14 @@ def test_sem_reforma_tributaria_sem_imposto_misto(self):
374354 xml = self ._serializar_e_assinar ()
375355
376356 # impostoMisto should NOT exist
377- imposto_misto = xml .xpath (
378- "//ns:det/ns:imposto/ns:impostoMisto" , namespaces = self .ns
379- )
357+ imposto_misto = xml .xpath ("//ns:det/ns:imposto/ns:impostoMisto" , namespaces = self .ns )
380358 self .assertEqual (len (imposto_misto ), 0 )
381359
382360 # No reform totals
383- vcbs_total = xml .xpath (
384- "//ns:total/ns:ICMSTot/ns:vCBS" , namespaces = self .ns
385- )
361+ vcbs_total = xml .xpath ("//ns:total/ns:ICMSTot/ns:vCBS" , namespaces = self .ns )
386362 self .assertEqual (len (vcbs_total ), 0 )
387363
388- vibs_total = xml .xpath (
389- "//ns:total/ns:ICMSTot/ns:vIBS" , namespaces = self .ns
390- )
364+ vibs_total = xml .xpath ("//ns:total/ns:ICMSTot/ns:vIBS" , namespaces = self .ns )
391365 self .assertEqual (len (vibs_total ), 0 )
392366
393367 # ------------------------------------------------------------------
@@ -479,29 +453,21 @@ def test_totais_acumulacao_multiplos_produtos(self):
479453 xml = self ._serializar_e_assinar ()
480454
481455 # Accumulated totals: CBS=132.00, IBS=265.50, IS=15.00
482- vcbs_total = xml .xpath (
483- "//ns:total/ns:ICMSTot/ns:vCBS" , namespaces = self .ns
484- )[0 ].text
456+ vcbs_total = xml .xpath ("//ns:total/ns:ICMSTot/ns:vCBS" , namespaces = self .ns )[0 ].text
485457 self .assertEqual (vcbs_total , "132.00" )
486458
487- vibs_total = xml .xpath (
488- "//ns:total/ns:ICMSTot/ns:vIBS" , namespaces = self .ns
489- )[0 ].text
459+ vibs_total = xml .xpath ("//ns:total/ns:ICMSTot/ns:vIBS" , namespaces = self .ns )[0 ].text
490460 self .assertEqual (vibs_total , "265.50" )
491461
492- vis_total = xml .xpath (
493- "//ns:total/ns:ICMSTot/ns:vIS" , namespaces = self .ns
494- )[0 ].text
462+ vis_total = xml .xpath ("//ns:total/ns:ICMSTot/ns:vIS" , namespaces = self .ns )[0 ].text
495463 self .assertEqual (vis_total , "15.00" )
496464
497465 # vNF = 1000 + 500 + 132 + 265.50 + 15 = 1912.50
498466 # Wait: vNF = sum of (vProd + IBS + CBS + IS) for each product
499467 # Prod1: 1000 + 177 + 88 + 10 = 1275
500468 # Prod2: 500 + 88.50 + 44 + 5 = 637.50
501469 # Total: 1275 + 637.50 = 1912.50
502- vnf = xml .xpath (
503- "//ns:total/ns:ICMSTot/ns:vNF" , namespaces = self .ns
504- )[0 ].text
470+ vnf = xml .xpath ("//ns:total/ns:ICMSTot/ns:vNF" , namespaces = self .ns )[0 ].text
505471 self .assertEqual (vnf , "1912.50" )
506472
507473 # ------------------------------------------------------------------
@@ -562,15 +528,15 @@ def test_misto_legacy_icms_pis_cofins_com_ibs_cbs(self):
562528 xml = self ._serializar_e_assinar ()
563529
564530 # Legacy ICMS still present
565- icms_cst = xml .xpath (
566- "//ns:det/ns:imposto/ns:ICMS/ns:ICMS00/ns:CST" , namespaces = self . ns
567- )[ 0 ].text
531+ icms_cst = xml .xpath ("//ns:det/ns:imposto/ns:ICMS/ns:ICMS00/ns:CST" , namespaces = self . ns )[
532+ 0
533+ ].text
568534 self .assertEqual (icms_cst , "00" )
569535
570536 # Legacy PIS still present
571- pis_cst = xml .xpath (
572- "//ns:det/ns:imposto/ns:PIS/ns:PISAliq/ns:CST" , namespaces = self . ns
573- )[ 0 ].text
537+ pis_cst = xml .xpath ("//ns:det/ns:imposto/ns:PIS/ns:PISAliq/ns:CST" , namespaces = self . ns )[
538+ 0
539+ ].text
574540 self .assertEqual (pis_cst , "01" )
575541
576542 # Legacy COFINS still present
@@ -592,9 +558,7 @@ def test_misto_legacy_icms_pis_cofins_com_ibs_cbs(self):
592558 self .assertEqual (ibs_cst , "02" )
593559
594560 # No IS in this test
595- is_group = xml .xpath (
596- "//ns:det/ns:imposto/ns:impostoMisto/ns:IS" , namespaces = self .ns
597- )
561+ is_group = xml .xpath ("//ns:det/ns:imposto/ns:impostoMisto/ns:IS" , namespaces = self .ns )
598562 self .assertEqual (len (is_group ), 0 )
599563
600564
0 commit comments