Skip to content

Commit

Permalink
fixed server calls
Browse files Browse the repository at this point in the history
  • Loading branch information
Mr-Squared committed Mar 12, 2023
1 parent 7e2a43c commit 79f5f05
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 6 deletions.
2 changes: 1 addition & 1 deletion src/report.py
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,6 @@ def report_bulk_generate_v1(invoices: List[Invoice]) -> List[Report]:

def report_bulk_export_v1(report_ids, report_format) -> List[ReportExport]:
export = ReportExport(url="", invoice_hash="")
exports = [export]
exports = [export for _ in report_ids]
return exports

2 changes: 1 addition & 1 deletion tests/bulk/bulk_export_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ def test_bulk_export_valid():

report_ids = invoice_file_upload_bulk_v1(invoices)

exports = report_bulk_export_v1(report_ids, Format(format="HTML"))
exports = report_bulk_export_v1(report_ids, Format(format="HTML")) # type: ignore

# Checking that the number of exports returned is the same as the number of invoices inputted
assert len(exports) == len(report_ids) == len(invoices)
6 changes: 2 additions & 4 deletions tests/server_calls.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,9 +36,7 @@ def invoice_upload_file_v1(invoice_name: str, invoice_filename) -> Server_call_r
return json.loads(response.text)

def invoice_file_upload_bulk_v1(invoices: List[Invoice]) -> Server_call_return:
payload = {
"invoices": [invoice.dict() for invoice in invoices]
}
payload = [invoice.dict() for invoice in invoices]
response = requests.post(full_url + 'invoice/file_upload_bulk/v1', json=payload)

return json.loads(response.text)
Expand Down Expand Up @@ -110,7 +108,7 @@ def report_peppol_v1(invoice: Invoice) -> Server_call_return:
def report_bulk_export_v1(report_ids: List[int], report_format: Format) -> Server_call_return:
payload = {
"report_ids": report_ids,
"report_format": report_format.format
"report_format": report_format.dict()
}
response = requests.get(full_url + 'report/bulk_export/v1', json=payload)

Expand Down

0 comments on commit 79f5f05

Please sign in to comment.