Page MenuHomeSoftware Heritage

D8481.id.diff
No OneTemporary

D8481.id.diff

diff --git a/swh/indexer/tests/metadata_dictionary/test_npm.py b/swh/indexer/tests/metadata_dictionary/test_npm.py
--- a/swh/indexer/tests/metadata_dictionary/test_npm.py
+++ b/swh/indexer/tests/metadata_dictionary/test_npm.py
@@ -294,6 +294,20 @@
}
+def test_npm_author():
+ package_json = rb"""{
+ "version": "1.0.0",
+ "author": "Foo Bar (@example)"
+}"""
+ result = MAPPINGS["NpmMapping"]().translate(package_json)
+ assert result == {
+ "@context": "https://doi.org/10.5063/schema/codemeta-2.0",
+ "type": "SoftwareSourceCode",
+ "author": [{"name": "Foo Bar", "type": "Person"}],
+ "version": "1.0.0",
+ }
+
+
def test_npm_invalid_uris():
package_json = rb"""{
"version": "1.0.0",

File Metadata

Mime Type
text/plain
Expires
Nov 4 2024, 4:24 PM (19 w, 4 d ago)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
3219394

Event Timeline