Changeset View
Changeset View
Standalone View
Standalone View
swh/indexer/tests/storage/test_converters.py
Show First 20 Lines • Show All 130 Lines • ▼ Show 20 Lines | |||||
def test_db_to_fossology_license() -> None: | def test_db_to_fossology_license() -> None: | ||||
input_license = { | input_license = { | ||||
"id": b"some-id", | "id": b"some-id", | ||||
"tool_id": 20, | "tool_id": 20, | ||||
"tool_name": "nomossa", | "tool_name": "nomossa", | ||||
"tool_version": "5.22", | "tool_version": "5.22", | ||||
"tool_configuration": {}, | "tool_configuration": {}, | ||||
"licenses": ["GPL2.0"], | "license": "GPL2.0", | ||||
} | } | ||||
expected_license = { | expected_license = { | ||||
"licenses": ["GPL2.0"], | "id": b"some-id", | ||||
"license": "GPL2.0", | |||||
"tool": {"id": 20, "name": "nomossa", "version": "5.22", "configuration": {},}, | "tool": {"id": 20, "name": "nomossa", "version": "5.22", "configuration": {},}, | ||||
} | } | ||||
actual_license = converters.db_to_fossology_license(input_license) | actual_license = converters.db_to_fossology_license(input_license) | ||||
assert actual_license == expected_license | assert actual_license == expected_license | ||||
Show All 24 Lines |