@@ -1084,8 +1084,9 @@ def test_user_sees_components_reordered_to_logical_sequence(self, model_instance
10841084 # Check that known components appear in the expected relative order
10851085 for _i , component in enumerate (expected_known_order ):
10861086 if component in component_order :
1087- assert component_order .index (component ) < component_order .index ("Custom Sensor" ), \
1087+ assert component_order .index (component ) < component_order .index ("Custom Sensor" ), (
10881088 f"Known component { component } should appear before unknown components"
1089+ )
10891090
10901091 # Custom/unknown components should be at the end
10911092 assert component_order [- 1 ] == "Custom Sensor"
@@ -1102,13 +1103,8 @@ def test_user_sees_product_fields_ordered_consistently(self, model_instance) ->
11021103 # Arrange: Create component with Product fields in wrong order
11031104 existing_components = {
11041105 "Flight Controller" : {
1105- "Product" : {
1106- "Manufacturer" : "Pixhawk" ,
1107- "URL" : "https://pixhawk.org" ,
1108- "Model" : "6C" ,
1109- "Version" : "1.0"
1110- },
1111- "Firmware" : {"Type" : "ArduCopter" , "Version" : "4.5.x" }
1106+ "Product" : {"Manufacturer" : "Pixhawk" , "URL" : "https://pixhawk.org" , "Model" : "6C" , "Version" : "1.0" },
1107+ "Firmware" : {"Type" : "ArduCopter" , "Version" : "4.5.x" },
11121108 }
11131109 }
11141110
@@ -1185,11 +1181,9 @@ def test_user_sees_components_without_product_sections_unchanged(self, model_ins
11851181 existing_components = {
11861182 "Flight Controller" : {
11871183 "Firmware" : {"Type" : "ArduCopter" , "Version" : "4.5.x" },
1188- "Specifications" : {"MCU Series" : "STM32H7" }
1184+ "Specifications" : {"MCU Series" : "STM32H7" },
11891185 },
1190- "Battery" : {
1191- "Specifications" : {"Chemistry" : "Lipo" , "Capacity mAh" : 5000 }
1192- }
1186+ "Battery" : {"Specifications" : {"Chemistry" : "Lipo" , "Capacity mAh" : 5000 }},
11931187 }
11941188
11951189 # Act: Reorder components
@@ -1217,24 +1211,24 @@ def test_user_sees_product_sections_with_missing_fields_handled_gracefully(self,
12171211 "Flight Controller" : {
12181212 "Product" : {
12191213 "Manufacturer" : "Pixhawk" ,
1220- "Model" : "6C"
1214+ "Model" : "6C" ,
12211215 # Missing Version and URL
12221216 }
12231217 },
12241218 "GNSS Receiver" : {
12251219 "Product" : {
12261220 "Manufacturer" : "u-blox" ,
1227- "Version" : "1.0"
1221+ "Version" : "1.0" ,
12281222 # Missing URL
12291223 }
12301224 },
12311225 "Telemetry" : {
12321226 "Product" : {
12331227 "Manufacturer" : "SiK" ,
1234- "URL" : "https://sik.org"
1228+ "URL" : "https://sik.org" ,
12351229 # Missing Version
12361230 }
1237- }
1231+ },
12381232 }
12391233
12401234 # Act: Reorder components
@@ -1273,7 +1267,7 @@ def test_user_sees_complex_product_sections_with_extra_fields_preserved(self, mo
12731267 "Version" : "1.0" ,
12741268 "Custom Field 2" : "Custom Value 2" ,
12751269 "Model" : "6C" ,
1276- "Custom Field 3" : "Custom Value 3"
1270+ "Custom Field 3" : "Custom Value 3" ,
12771271 }
12781272 }
12791273 }
@@ -1290,8 +1284,9 @@ def test_user_sees_complex_product_sections_with_extra_fields_preserved(self, mo
12901284 version_idx = product_fields .index ("Version" )
12911285 url_idx = product_fields .index ("URL" )
12921286
1293- assert manufacturer_idx < model_idx < version_idx < url_idx , \
1287+ assert manufacturer_idx < model_idx < version_idx < url_idx , (
12941288 "Standard fields should be in correct order: Manufacturer, Model, Version, URL"
1289+ )
12951290
12961291 # Custom fields should appear after standard fields
12971292 custom1_idx = product_fields .index ("Custom Field 1" )
0 commit comments