Changeset View
Changeset View
Standalone View
Standalone View
swh/loader/package/nixguix/tests/test_nixguix.py
Show First 20 Lines • Show All 77 Lines • ▼ Show 20 Lines | sources = { | ||||
# Valid source | # Valid source | ||||
{"type": "url", "urls": ["my-url"], "integrity": "my-integrity"}, | {"type": "url", "urls": ["my-url"], "integrity": "my-integrity"}, | ||||
# integrity is missing | # integrity is missing | ||||
{"type": "url", "urls": ["my-url"],}, | {"type": "url", "urls": ["my-url"],}, | ||||
# urls is not a list | # urls is not a list | ||||
{"type": "url", "urls": "my-url", "integrity": "my-integrity"}, | {"type": "url", "urls": "my-url", "integrity": "my-integrity"}, | ||||
# type is not url | # type is not url | ||||
{"type": "git", "urls": ["my-url"], "integrity": "my-integrity"}, | {"type": "git", "urls": ["my-url"], "integrity": "my-integrity"}, | ||||
# missing fields which got double-checked nonetheless... | |||||
{"integrity": "my-integrity"}, | |||||
], | ], | ||||
"revision": "my-revision", | "revision": "my-revision", | ||||
} | } | ||||
clean = clean_sources(sources) | clean = clean_sources(sources) | ||||
assert len(clean["sources"]) == 1 | assert len(clean["sources"]) == 1 | ||||
▲ Show 20 Lines • Show All 466 Lines • Show Last 20 Lines |