Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unit tests failing on mac os #149

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions entrada.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
020210802210007000000281S203Joao Da Silva Rua 76 km 34.5 Alagoas PJ54482221-l 000000000025000DOL0019800000Observaciones comerciales Sin observaciones 30 dias FOBFlete a Bordo 1 988888888888345
1PRO1 000002000000010001500000000000000025000000050000000Producto Tipo 1 Exportacion MERCOSUR ISO 9001
299999AAXX999999A225
301900020000123420111111111
3 changes: 3 additions & 0 deletions env/pyvenv.cfg
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
home = /Users/Abhishek/.asdf/installs/python/3.8.10/bin
include-system-site-packages = false
version = 3.8.10
49 changes: 49 additions & 0 deletions env/share/man/man1/qr.1
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
.\" Manpage for qr
.TH QR 1 "14 Jan 2019" "6.1" "Python QR tool"
.SH NAME
qr \- script to create QR codes at the command line
.SH SYNOPSIS
qr [\-\-help] [\-\-factory=FACTORY] [\-\-optimize=OPTIMIZE] [\-\-error\-correction=LEVEL] [data]
.SH DESCRIPTION
This script uses the python qrcode module. It can take data from stdin or from the commandline and generate a QR code.
Normally it will output the QR code as ascii art to the terminal. If the output is piped to a file, it will output the image (default type of PNG).
.SH OPTIONS
.PP
\fB\ \-h, \-\-help\fR
.RS 4
Show a help message.
.RE

.PP
\fB\ \-\-factory=FACTORY\fR
.RS 4
Full python path to the image factory class to create the
image with. You can use the following shortcuts to the
built-in image factory classes: pil (default), pymaging,
svg, svg-fragment, svg-path.
.RE

.PP
\fB\ \-\-optimize=OPTIMIZE\fR
.RS 4
Optimize the data by looking for chunks of at least this
many characters that could use a more efficient encoding
method. Use 0 to turn off chunk optimization.
.RE

.PP
\fB\ \-\-error\-correction=LEVEL\fR
.RS 4
The error correction level to use. Choices are L (7%),
M (15%, default), Q (25%), and H (30%).
.RE

.PP
\fB\ data\fR
.RS 4
The data from which the QR code will be generated.
.RE

.SH SEE ALSO
https://github.com/lincolnloop/python-qrcode/

102 changes: 102 additions & 0 deletions facturas.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,102 @@
[
{
"cae": "61233038185853",
"cbt_numero": "7",
"cbte_nro": "7",
"concepto": "1",
"condicion_frente_iva": "Exento",
"cuit": "20205766",
"datos": [
{
"campo": "domicilio",
"pagina": "",
"valor": null
},
{
"campo": "nombre",
"pagina": "",
"valor": null
},
{
"campo": "telefono",
"pagina": "",
"valor": null
},
{
"campo": "categoria",
"pagina": "",
"valor": null
},
{
"campo": "localidad",
"pagina": "",
"valor": null
}
],
"detalles": [
{
"codigo": "P1675G",
"ds": "PRUEBA ART",
"imp_iva": "0.00",
"importe": "1076.68",
"iva_id": "0",
"numero_despacho": "110170P",
"precio": "1076.68",
"qty": "1.0",
"umed": "07"
}
],
"domicilio_cliente": "Patricia 1 - Cdad de Buenos Aires - 1405 - Capital Federal - Argentina",
"email": "[email protected]",
"fecha_cbte": "20110609",
"fecha_serv_desde": "",
"fecha_serv_hasta": "",
"fecha_venc_pago": "",
"fecha_vto": "20110619",
"forma_pago": "30 Dias",
"id": "1",
"id_impositivo": null,
"idioma": "1",
"imp_iva": "186.86",
"imp_neto": "889.82",
"imp_op_ex": "0.00",
"imp_tot_conc": "0.00",
"imp_total": "1085.57",
"imp_trib": "8.89",
"ivas": [
{
"base_imp": "889.82",
"importe": "186.86",
"iva_id": "5"
}
],
"localidad_cliente": null,
"moneda_ctz": "1.000000",
"moneda_id": "PES",
"motivo": "",
"nombre_cliente": "Cliente XXX",
"nro_doc": "30500010912",
"numero_cliente": "21601192",
"numero_cotizacion": "82016336",
"numero_orden_compra": "6443",
"numero_remito": "00008001",
"obs_comerciales": null,
"obs_generales": null,
"provincia_cliente": null,
"punto_vta": "5",
"reproceso": "S",
"resultado": "A",
"telefono_cliente": null,
"tipo_cbte": "6",
"tipo_doc": "80",
"tributos": [
{
"alic": "1.00",
"base_imp": "889.82",
"desc": "Impuesto municipal matanza",
"importe": "8.89",
"tributo_id": "99"
}
]
}
]
6 changes: 5 additions & 1 deletion nsis.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,9 @@

from builtins import str
from builtins import object

from test_wslsp import open_file


__author__ = "Mariano Reingart ([email protected])"
__copyright__ = "Copyright (C) 2011-2021 Mariano Reingart"
Expand Down Expand Up @@ -306,7 +309,8 @@ def create(self, pathname="base.nsi"):
)

def compile(self, pathname="base.nsi"):
os.startfile(pathname, "compile")
# os.startfile(pathname, "compile")
open_file(pathname, "compile")


class Target(object):
Expand Down
4 changes: 3 additions & 1 deletion padron.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
from __future__ import division
from __future__ import print_function
from __future__ import absolute_import
from test_wslsp import open_file

# Documentación e información adicional:
# http://www.sistemasagiles.com.ar/trac/wiki/PadronContribuyentesAFIP
Expand Down Expand Up @@ -514,7 +515,8 @@ def MostrarPDF(self, archivo, imprimir=False):
os.system("evince " "%s" "" % archivo)
else:
operation = imprimir and "print" or ""
os.startfile(archivo, operation)
# os.startfile(archivo, operation)
open_file(archivo, operation)
return True

@inicializar_y_capturar_excepciones_simple
Expand Down
4 changes: 3 additions & 1 deletion pyfepdf.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
from __future__ import absolute_import

from future import standard_library
from test_wslsp import open_file

standard_library.install_aliases()
from builtins import input
Expand Down Expand Up @@ -1655,7 +1656,8 @@ def MostrarPDF(self, archivo, imprimir=False):
os.system("evince " "%s" "" % archivo)
else:
operation = imprimir and "print" or ""
os.startfile(archivo, operation)
# os.startfile(archivo, operation)
open_file(archivo, operation)
return True

@utils.inicializar_y_capturar_excepciones_simple
Expand Down
4 changes: 3 additions & 1 deletion pyi25.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
from __future__ import division
from __future__ import print_function
from __future__ import absolute_import
from test_wslsp import open_file

from builtins import str
from builtins import range
Expand Down Expand Up @@ -259,7 +260,8 @@ def main():
elif sys.platform == "linux2" or sys.platform == "linux":
os.system("eog " "%s" "" % archivo)
else:
os.startfile(archivo)
# os.startfile(archivo)
open_file(archivo)

if __name__ == "__main__":
main()
4 changes: 3 additions & 1 deletion pyqr.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
from __future__ import print_function
from __future__ import unicode_literals
from builtins import object
from test_wslsp import open_file

__author__ = "Mariano Reingart <[email protected]>"
__copyright__ = "Copyright (C) 2020-2021 Mariano Reingart"
Expand Down Expand Up @@ -288,7 +289,8 @@ def main():
elif sys.platform == "linux2" or sys.platform == "linux":
os.system("eog " "%s" "" % pyqr.Archivo)
else:
os.startfile(pyqr.Archivo)
# os.startfile(pyqr.Archivo)
open_file(pyqr.Archivo)

return url

Expand Down
7 changes: 7 additions & 0 deletions tests/test_pyfepdf.py
Original file line number Diff line number Diff line change
Expand Up @@ -348,9 +348,16 @@ def test_main_grabar_json():
os.remove('facturas.json')


from test_wslsp import open_file

def new_mostrar_pdf(self, archivo, imprimir=False):
if sys.platform.startswith(("linux2", "java", "linux")):
os.system("evince " "%s" "" % archivo)

def test_mostrar_pdf(mocker):
sys.argv = []
mocker.patch("os.system")
mocker.patch("pyafipws.pyfepdf.FEPDF.MostrarPDF", new=new_mostrar_pdf)
config = SafeConfigParser()
config.read(CONFIG_FILE)
conf_fact = dict(config.items("FACTURA"))
Expand Down
Loading