File tree Expand file tree Collapse file tree 3 files changed +10
-3
lines changed
src/frequenz/client/microgrid/component
tests/component/component_proto Expand file tree Collapse file tree 3 files changed +10
-3
lines changed Original file line number Diff line number Diff line change @@ -179,7 +179,10 @@ def component_base_from_proto_with_issues(
179179 and isinstance (category , ComponentCategory )
180180 and category .name .lower () != category_specific_info_kind
181181 ):
182- major_issues .append ("category_type.metadata does not match the category_type" )
182+ major_issues .append (
183+ f"category_specific_info.kind ({ category_specific_info_kind } ) does not "
184+ f"match the category ({ category .name .lower ()} )" ,
185+ )
183186 category_mismatched = True
184187
185188 return ComponentBaseData (
Original file line number Diff line number Diff line change @@ -91,7 +91,9 @@ def test_category_specific_info_mismatch(
9191 proto , major_issues = major_issues , minor_issues = minor_issues
9292 )
9393 # Actual message from _component_base_from_proto_with_issues
94- assert major_issues == ["category_type.metadata does not match the category_type" ]
94+ assert major_issues == [
95+ "category_specific_info.kind (battery) does not match the category (grid_connection_point)"
96+ ]
9597 assert not minor_issues
9698 assert parsed == base_data
9799
Original file line number Diff line number Diff line change @@ -92,7 +92,9 @@ def test_category_mismatch(default_component_base_data: ComponentBaseData) -> No
9292 )
9393 # The actual message from component_from_proto_with_issues via
9494 # _component_base_from_proto_with_issues
95- assert major_issues == ["category_type.metadata does not match the category_type" ]
95+ assert major_issues == [
96+ "category_specific_info.kind (battery) does not match the category (grid_connection_point)"
97+ ]
9698 assert not minor_issues
9799 assert isinstance (component , MismatchedCategoryComponent )
98100 assert_base_data (base_data , component )
You can’t perform that action at this time.
0 commit comments