Skip to content

Commit

Permalink
test suite for recex1.py
Browse files Browse the repository at this point in the history
Signed-off-by: SONIABHISHEK121 <[email protected]>
  • Loading branch information
ABHISHEKSONI121 committed Jul 18, 2024
1 parent b6da2b6 commit 5e94653
Show file tree
Hide file tree
Showing 2 changed files with 517 additions and 1 deletion.
11 changes: 10 additions & 1 deletion recex1.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@
import traceback

# revisar la instalación de pyafip.ws:
from pyafipws.wsaa import WSAA
from pyafipws import wsfexv1
from pyafipws.utils import SimpleXMLElement, SoapClient, SoapFault, date
from pyafipws.utils import leer, escribir, leer_dbf, guardar_dbf, N, A, I, abrir_conf
Expand Down Expand Up @@ -333,10 +334,18 @@ def main():

if config.has_option("WSFEXv1", "TIMEOUT"):
TIMEOUT = int(config.get("WSFEXv1", "TIMEOUT"))

# This change handles the case where 'proxy_port' may not be present in the config.
# It ensures that we only try to convert 'proxy_port' to an integer if it exists,
# preventing KeyError exceptions and making the code more robust to different
# configuration scenarios. This modification allows the function to work with
# or without proxy settings, improving its flexibility and error handling.

if config.has_section("PROXY") and not HOMO:
proxy_dict = dict(("proxy_%s" % k, v) for k, v in config.items("PROXY"))
proxy_dict["proxy_port"] = int(proxy_dict["proxy_port"])
if "proxy_port" in proxy_dict:
proxy_dict["proxy_port"] = int(proxy_dict["proxy_port"])

else:
proxy_dict = {}

Expand Down
Loading

0 comments on commit 5e94653

Please sign in to comment.