mirror of
https://github.com/platformio/platformio-core.git
synced 2025-07-30 10:07:14 +02:00
Fix issue with library.properties manifest parser when author email is not specified
This commit is contained in:
@ -480,7 +480,7 @@ class LibraryPropertiesManifestParser(BaseManifestParser):
|
|||||||
continue
|
continue
|
||||||
found = True
|
found = True
|
||||||
item["maintainer"] = True
|
item["maintainer"] = True
|
||||||
if not item.get("email"):
|
if not item.get("email") and email:
|
||||||
item["email"] = email
|
item["email"] = email
|
||||||
if not found:
|
if not found:
|
||||||
authors.append(
|
authors.append(
|
||||||
|
@ -161,6 +161,7 @@ customField=Custom Value
|
|||||||
"architectures=*\n" + contents
|
"architectures=*\n" + contents
|
||||||
).as_dict()
|
).as_dict()
|
||||||
assert data["platforms"] == ["*"]
|
assert data["platforms"] == ["*"]
|
||||||
|
|
||||||
# Platforms specific
|
# Platforms specific
|
||||||
data = parser.LibraryPropertiesManifestParser(
|
data = parser.LibraryPropertiesManifestParser(
|
||||||
"architectures=avr, esp32\n" + contents
|
"architectures=avr, esp32\n" + contents
|
||||||
@ -184,7 +185,7 @@ customField=Custom Value
|
|||||||
"type": "git",
|
"type": "git",
|
||||||
}
|
}
|
||||||
|
|
||||||
# Hope page
|
# Home page
|
||||||
data = parser.LibraryPropertiesManifestParser(
|
data = parser.LibraryPropertiesManifestParser(
|
||||||
"url=https://github.com/username/reponame.git\n" + contents
|
"url=https://github.com/username/reponame.git\n" + contents
|
||||||
).as_dict()
|
).as_dict()
|
||||||
@ -193,6 +194,17 @@ customField=Custom Value
|
|||||||
"url": "https://github.com/username/reponame.git",
|
"url": "https://github.com/username/reponame.git",
|
||||||
}
|
}
|
||||||
|
|
||||||
|
# Author + Maintainer
|
||||||
|
data = parser.LibraryPropertiesManifestParser(
|
||||||
|
"""
|
||||||
|
author=Rocket Scream Electronics
|
||||||
|
maintainer=Rocket Scream Electronics
|
||||||
|
"""
|
||||||
|
).as_dict()
|
||||||
|
assert data["authors"] == [
|
||||||
|
{"name": "Rocket Scream Electronics", "maintainer": True}
|
||||||
|
]
|
||||||
|
|
||||||
|
|
||||||
def test_library_json_schema():
|
def test_library_json_schema():
|
||||||
contents = """
|
contents = """
|
||||||
|
Reference in New Issue
Block a user