Changeset View
Changeset View
Standalone View
Standalone View
swh/indexer/tests/utils.py
Show First 20 Lines • Show All 367 Lines • ▼ Show 20 Lines | '636465': b""" | ||||
"mocha": "^5.2.0", | "mocha": "^5.2.0", | ||||
"request": "^2.87.0", | "request": "^2.87.0", | ||||
"test": "^0.6.0" | "test": "^0.6.0" | ||||
} | } | ||||
} | } | ||||
""" | """ | ||||
} | } | ||||
CONTENT_METADATA = [{ | |||||
'tool': { | |||||
'configuration': { | |||||
'type': 'local', | |||||
'context': 'NpmMapping' | |||||
}, | |||||
'version': '0.0.1', | |||||
'id': 6, | |||||
'name': 'swh-metadata-translator' | |||||
}, | |||||
'id': b'cde', | |||||
'translated_metadata': { | |||||
'@context': 'https://doi.org/10.5063/schema/codemeta-2.0', | |||||
'type': 'SoftwareSourceCode', | |||||
'codemeta:issueTracker': | |||||
'https://github.com/librariesio/yarn-parser/issues', | |||||
'version': '1.0.0', | |||||
'name': 'yarn-parser', | |||||
'schema:author': 'Andrew Nesbitt', | |||||
'url': | |||||
'https://github.com/librariesio/yarn-parser#readme', | |||||
'processorRequirements': {'node': '7.5'}, | |||||
'license': 'AGPL-3.0', | |||||
'keywords': ['yarn', 'parse', 'lock', 'dependencies'], | |||||
'schema:codeRepository': | |||||
'git+https://github.com/librariesio/yarn-parser.git', | |||||
'description': | |||||
'Tiny web service for parsing yarn.lock files', | |||||
} | |||||
}] | |||||
def filter_dict(d, keys): | def filter_dict(d, keys): | ||||
'return a copy of the dict with keys deleted' | 'return a copy of the dict with keys deleted' | ||||
if not isinstance(keys, (list, tuple)): | if not isinstance(keys, (list, tuple)): | ||||
keys = (keys, ) | keys = (keys, ) | ||||
return dict((k, v) for (k, v) in d.items() if k not in keys) | return dict((k, v) for (k, v) in d.items() if k not in keys) | ||||
▲ Show 20 Lines • Show All 227 Lines • Show Last 20 Lines |