se extrae libreria de etrivial
FossilOrigin-Name: 5cae2a8c5985850e97b3d416ba14a90c66e2c05e3a4f9c28fdbc767d6c29748f
This commit is contained in:
44
tests/test_client_dian.py
Normal file
44
tests/test_client_dian.py
Normal file
@@ -0,0 +1,44 @@
|
||||
#!/usr/bin/env python
|
||||
# -*- coding: utf-8 -*-
|
||||
# This file is part of facho. The COPYRIGHT file at the top level of
|
||||
# this repository contains the full copyright notices and license terms.
|
||||
|
||||
from facho.fe.client import dian
|
||||
from facho import facho
|
||||
|
||||
import pytest
|
||||
|
||||
|
||||
from datetime import datetime
|
||||
|
||||
class FakeDianClient(dian.DianClient):
|
||||
def __init__(self, username, password, resp):
|
||||
super().__init__(username, password)
|
||||
self.response = resp
|
||||
|
||||
def _open(self, service):
|
||||
return None
|
||||
|
||||
def _close(self, conn):
|
||||
pass
|
||||
|
||||
def _remote_service(self, conn, service):
|
||||
def fake_remote(**kw):
|
||||
return self.response
|
||||
return fake_remote
|
||||
|
||||
|
||||
|
||||
def test_sopa_consultaresolucionesfacturacion():
|
||||
expected_resp = {
|
||||
'CodigoOperacion': 'OK',
|
||||
'DescripcionOperacion': '',
|
||||
'IdentificadorOperacion': '',
|
||||
'RangoFacturacion': []
|
||||
}
|
||||
|
||||
client_dian = FakeDianClient('user', 'pass', expected_resp)
|
||||
resp = client_dian.request(dian.ConsultaResolucionesFacturacionPeticion(
|
||||
'860046645', '800037646', '13a6a789-47ca-4728-adb8-372fca76e692'
|
||||
))
|
||||
assert resp.CodigoOperacion == 'OK'
|
||||
Reference in New Issue
Block a user