def test_compute_metadata_pubspec():
raw_content = """
---
name: newtify
description: >-
Have you been turned into a newt? Would you like to be?
This package can help. It has all of the
newt-transmogrification functionality you have been looking
for.
keywords:
- polyfill
- shim
- compatibility
- portable
- mbstring
version: 1.2.3
license: MIT
homepage: https://example-pet-store.com/newtify
documentation: https://example-pet-store.com/newtify/docs
environment:
sdk: '>=2.10.0 <3.0.0'
dependencies:
efts: ^2.0.4
transmogrify: ^0.4.0
dev_dependencies:
test: '>=1.15.0 <2.0.0'
""".encode(
"utf-8"
)
result = MAPPINGS["PubMapping"]().translate(raw_content)
expected = {
"@context": "https://doi.org/10.5063/schema/codemeta-2.0",
"type": "SoftwareSourceCode",
"name": "newtify",
"keywords": [
"polyfill",
"shim",
"compatibility",
"portable",
"mbstring",
],
"description": """Have you been turned into a newt? Would you like to be? \
This package can help. It has all of the \
newt-transmogrification functionality you have been looking \
for.""",
"url": "https://example-pet-store.com/newtify",
"license": "https://spdx.org/licenses/MIT",
}
> assert result == expected
E AssertionError: assert {'@context': ...newtify', ...} == {'@context': ...ses/MIT', ...}
E Omitting 6 identical items, use -vv to show
E Right contains 1 more item:
E {'license': 'https://spdx.org/licenses/MIT'}
E Full diff:
E {
E '@context': 'https://doi.org/10.5063/schema/codemeta-2.0',
E 'description': 'Have you been turned into a newt? Would you like to be? This '...
E
E ...Full output truncated (13 lines hidden), use '-vv' to show
.tox/py3/lib/python3.7/site-packages/swh/indexer/tests/metadata_dictionary/test_pubspec.py:63: AssertionError
TEST RESULT
TEST RESULT
- Run At
- Jul 8 2022, 10:37 AM