Skip to content

Commit

Permalink
version dependent assertion issues fixed
Browse files Browse the repository at this point in the history
Signed-off-by: UTKARSH KUMAR <Utkarshdhsbgp@gmail.com>
  • Loading branch information
chazuttu committed Jun 27, 2021
1 parent addf489 commit 6778dd6
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 21 deletions.
9 changes: 5 additions & 4 deletions tests/test_wsaa.py
Original file line number Diff line number Diff line change
Expand Up @@ -91,10 +91,11 @@ def test_login_cms(key_and_cert):

ta = SimpleXMLElement(ta_xml)

if sys.version_info[0] == 3:
assert isinstance(cms,str)
elif sys.version_info[0] == 2:
assert isinstance(cms.decode('utf-8'),str)
if not isinstance(cms,str):
cms = cms.decode('utf-8')

assert isinstance(cms,str)


assert cms.startswith('MIIG+')

Expand Down
8 changes: 3 additions & 5 deletions tests/test_wsbfev1.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
from pyafipws.wsaa import WSAA
from pyafipws.wsbfev1 import WSBFEv1
from pysimplesoap.simplexml import SimpleXMLElement
import future
from builtins import str

__WSDL__ = "http://wswhomo.afip.gov.ar/WSBFEv1/service.asmx"
__obj__ = WSBFEv1()
Expand Down Expand Up @@ -159,10 +159,8 @@ def test_autorizar(auth):

assert (wsbfev1.Resultado== "A")

if sys.version_info[0] == 3:
assert isinstance(wsbfev1.CAE,str)
elif sys.version_info[0] == 2:
assert isinstance((wsbfev1.CAE),future.types.newstr)
assert isinstance(wsbfev1.CAE,str)


assert (wsbfev1.CAE)
# ten = datetime.now() + timedelta(days=10)
Expand Down
8 changes: 4 additions & 4 deletions tests/test_wsfev1.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@

from pyafipws.wsaa import WSAA
from pyafipws.wsfev1 import WSFEv1
from builtins import str

"Pruebas para WSFEv1 de AFIP (Factura Electrónica Mercado Interno sin detalle)"

Expand Down Expand Up @@ -133,10 +134,9 @@ def test_autorizar_comprobante(auth, tipo_cbte=1, cbte_nro=None, servicios=True)

assert (wsfev1.Resultado== "A") # Aprobado!

if sys.version_info[0] == 3:
assert isinstance(wsfev1.CAE,str)
elif sys.version_info[0] == 2:
assert isinstance((wsfev1.CAE),future.types.newstr)

assert isinstance(wsfev1.CAE,str)


assert (len(wsfev1.CAE)==len("63363178822329"))
assert (len(wsfev1.Vencimiento)==len("20130907"))
Expand Down
13 changes: 5 additions & 8 deletions tests/test_wsfexv1.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
from pyafipws.wsaa import WSAA
from pyafipws.wsfexv1 import WSFEXv1
import future
from builtins import str

__author__ = "Mariano Reingart <reingart@gmail.com>"
__copyright__ = "Copyright (C) 2010-2019 Mariano Reingart"
Expand Down Expand Up @@ -170,10 +171,8 @@ def test_autorizar(auth):

assert (wsfexv1.Resultado == "A")

if sys.version_info[0] == 3:
assert isinstance(wsfexv1.CAE,str)
elif sys.version_info[0] == 2:
assert isinstance((wsfexv1.CAE),future.types.newstr)
assert isinstance(wsfexv1.CAE,str)


assert (wsfexv1.CAE)

Expand Down Expand Up @@ -233,9 +232,7 @@ def test_parametros(auth):
assert (wsfexv1.GetParamIncoterms())
assert (wsfexv1.GetParamMonConCotizacion())
#assert (wsfexv1.GetParamPtosVenta())
if sys.version_info[0] == 3:
assert isinstance(wsfexv1.GetParamCtz("DOL"),str)
elif sys.version_info[0] == 2:
assert isinstance((wsfexv1.GetParamCtz("DOL")),future.types.newstr)
assert isinstance(wsfexv1.GetParamCtz("DOL"),str)



0 comments on commit 6778dd6

Please sign in to comment.