MCPcopy Create free account
hub / github.com/FastLED/FastLED / test_parse_valid_json

Method test_parse_valid_json

ci/tests/test_package.py:140–159  ·  view source on GitHub ↗

Test parsing valid package index JSON

(self)

Source from the content-addressed store, hash-verified

138 """Test PackageIndexParser functionality"""
139
140 def test_parse_valid_json(self) -> None:
141 """Test parsing valid package index JSON"""
142 valid_json: dict[str, Any] = {
143 "packages": [
144 {
145 "name": "test",
146 "maintainer": "Test Maintainer",
147 "websiteURL": "https://example.com",
148 "email": "test@example.com",
149 "help": {"online": "https://example.com"},
150 "platforms": [],
151 "tools": [],
152 }
153 ]
154 }
155
156 parser = PackageIndexParser()
157 package_index = parser.parse_package_index(json.dumps(valid_json))
158 assert len(package_index.packages) == 1
159 assert package_index.packages[0].name == "test"
160
161 def test_parse_invalid_json(self) -> None:
162 """Test parsing invalid JSON"""

Callers

nothing calls this directly

Calls 2

parse_package_indexMethod · 0.95
PackageIndexParserClass · 0.90

Tested by

no test coverage detected