Fix: Modificacion estructura del Proyecto

This commit is contained in:
2024-10-19 09:35:55 -05:00
parent d69441779b
commit 4d5a88145d
10 changed files with 4 additions and 4 deletions

26
Api/test/test_main.py Normal file
View File

@@ -0,0 +1,26 @@
#!/usr/bin/env python3
from fastapi.testclient import TestClient
from ..api import app
import json
client = TestClient(app)
def load_json(file_path):
with open(file_path, 'r') as filejson:
return json.load(filejson)
def test_print_bill():
test_info = {
"content": str(
json.dumps(
load_json('test/fixtures/bill.json')
)),
"ip_printer": "192.168.1.100",
"user_name": "Juan"
}
response = client.post("/print_bill", json=test_info)
assert response.status_code == 200
assert response.content.decode() == "!Impresion Realizada!"