Changeset View
Changeset View
Standalone View
Standalone View
swh/loader/package/npm/tests/test_npm.py
Show All 28 Lines | for author, expected_author in [ | ||||
("author", "author"), | ("author", "author"), | ||||
( | ( | ||||
["Al from quantum leap", "hal from 2001 space odyssey"], | ["Al from quantum leap", "hal from 2001 space odyssey"], | ||||
"Al from quantum leap", | "Al from quantum leap", | ||||
), | ), | ||||
([], ""), | ([], ""), | ||||
({"name": "groot", "email": "groot@galaxy.org",}, "groot <groot@galaxy.org>"), | ({"name": "groot", "email": "groot@galaxy.org",}, "groot <groot@galaxy.org>"), | ||||
({}, ""), | ({}, ""), | ||||
({"name": []}, "",), | |||||
( | |||||
{"name": ["Susan McSween", "William H. Bonney", "Doc Scurlock",]}, | |||||
"Susan McSween", | |||||
), | |||||
]: | ]: | ||||
assert _author_str(author) == expected_author | assert _author_str(author) == expected_author | ||||
def test_extract_npm_package_author(datadir): | def test_extract_npm_package_author(datadir): | ||||
package_metadata_filepath = os.path.join( | package_metadata_filepath = os.path.join( | ||||
datadir, "https_replicate.npmjs.com", "org_visit1" | datadir, "https_replicate.npmjs.com", "org_visit1" | ||||
) | ) | ||||
▲ Show 20 Lines • Show All 591 Lines • Show Last 20 Lines |