@@ -172,7 +172,7 @@ def sandbox_auth():
172172 "http://schema.org/license" : [{"@id" : "https://spdx.org/licenses/Apache-2.0" }],
173173 "http://schema.org/name" : [{"@value" : "Test" }],
174174 "http://schema.org/url" : [
175- {"@id" : ' https://arxiv.org/abs/2201.09015' },
175+ {"@id" : " https://arxiv.org/abs/2201.09015" },
176176 {"@id" : "https://docs.software-metadata.pub/en/latest" }
177177 ],
178178 "http://schema.org/version" : [{"@value" : "9.0.1" }]
@@ -398,30 +398,45 @@ def test_file_deposit(tmp_path, monkeypatch, metadata):
398398 if e .code != 0 :
399399 raise e
400400 finally :
401- with open (' codemeta.json' , 'r' ) as cache :
401+ with open (" codemeta.json" , "r" ) as cache :
402402 result = SoftwareMetadata (json .load (cache ))
403403 sys .argv = orig_argv
404404
405405 assert result == metadata
406406
407407
408408@pytest .mark .parametrize (
409- "metadata" ,
409+ "metadata, invenio_metadata " ,
410410 [
411- SoftwareMetadata ({
412- "@type" : ["http://schema.org/SoftwareSourceCode" ],
413- "http://schema.org/description" : [{"@value" : "for testing" }],
414- "http://schema.org/name" : [{"@value" : "Test" }],
415- "http://schema.org/author" : [{
416- "@type" : "http://schema.org/Person" ,
417- "http://schema.org/familyName" : [{"@value" : "Test" }],
418- "http://schema.org/givenName" : [{"@value" : "Testi" }]
419- }],
420- "http://schema.org/license" : [{"@id" : "https://spdx.org/licenses/apache-2.0" }]
421- }),
411+ (
412+ SoftwareMetadata ({
413+ "@type" : ["http://schema.org/SoftwareSourceCode" ],
414+ "http://schema.org/description" : [{"@value" : "for testing" }],
415+ "http://schema.org/name" : [{"@value" : "Test" }],
416+ "http://schema.org/author" : [{
417+ "@type" : "http://schema.org/Person" ,
418+ "http://schema.org/familyName" : [{"@value" : "Test" }],
419+ "http://schema.org/givenName" : [{"@value" : "Testi" }]
420+ }],
421+ "http://schema.org/license" : [{"@id" : "https://spdx.org/licenses/Apache-2.0" }]
422+ }),
423+ {
424+ "upload_type" : "software" ,
425+ "publication_date" : "2026-02-02" ,
426+ "title" : "Test" ,
427+ "creators" : [{"name" : "Test, Testi" }],
428+ "description" : "for testing" ,
429+ "access_right" : "closed" ,
430+ "license" : "apache-2.0" ,
431+ "prereserve_doi" : True ,
432+ "related_identifiers" : [
433+ {"identifier" : "10.5281/zenodo.13311079" , "relation" : "isCompiledBy" , "scheme" : "doi" }
434+ ]
435+ }
436+ )
422437 ]
423438)
424- def test_invenio_deposit (tmp_path , monkeypatch , sandbox_auth , metadata ):
439+ def test_invenio_deposit (tmp_path , monkeypatch , sandbox_auth , metadata , invenio_metadata ):
425440 monkeypatch .chdir (tmp_path )
426441
427442 manager = context_manager .HermesContext (tmp_path )
@@ -453,10 +468,10 @@ def test_invenio_deposit(tmp_path, monkeypatch, sandbox_auth, metadata):
453468 raise e
454469 finally :
455470 manager .prepare_step ("deposit" )
456- with manager ["deposit " ] as cache :
457- result = cache ["result " ]
471+ with manager ["invenio " ] as cache :
472+ result = cache ["deposit " ]
458473 manager .finalize_step ("deposit" )
459474 sys .argv = orig_argv
460475
461476 # TODO: compare to actually expected value
462- assert result == {}
477+ assert result == invenio_metadata
0 commit comments