feat(license): wrap GET /license/export-csv endpoint#196
Conversation
Refs fossology#52. Adds LicenseEndpoint.export_licenses_csv() for GET /license/export-csv, the export counterpart to the merged import_licenses_csv() (fossology#185). Returns the exported licenses as CSV text and accepts an optional license id (0 = all). Verified against Fossology 4.4.0 (API 1.6.1) running in a container: an export->import round-trip test passes (idempotent), plus a mocked 403 error path. Signed-off-by: RAJVEER42 <irajveer.bishnoi2310@gmail.com>
|
@Valyrian-Code thanks again for the PR. Could you also add a test to verify that single license can also be exported using the "id" parameter? And verify that the exported csv the expected number of licenses contains? |
Add two tests requested during review of fossology#196: - export a single license with export_licenses_csv(id) and assert the CSV contains exactly that one license (header row + one data row) - assert the full export (no id) returns more than one license Verified live against Fossology 4.4.0 (API 1.6.1). Signed-off-by: RAJVEER42 <irajveer.bishnoi2310@gmail.com>
|
Thanks @deveaud-m! Added in
Both verified live against a Fossology 4.4.0 container. One note on "expected number": I did not assert the full-export row count against |
|
Hi @deveaud-m, thanks again for the reviews on these. Most of what I've sent has been merged now: the report endpoints (#178, #184), the license CSV import (#185), and the upload analysis + agents endpoints (#197, #198). I'd like to get more involved in Happy to help with:
Is there a good way to get more regularly involved? |
Refs #52.
Adds
LicenseEndpoint.export_licenses_csv()forGET /license/export-csv— the export counterpart to the mergedimport_licenses_csv()(#185). Returns the exported licenses as CSV text and accepts an optional licenseid(0= all).API details
Verified against Fossology 4.4.0 (API 1.6.1) running in a container.
Tests
export → importround-trip — passes live. Idempotent, and robust because the export output is exactly whatimport_licenses_csv()expects.403error path.ruffandmypypass; the export tests pass against a live fossology 4.4.0 container.