4848def valid_microgrid_config () -> MicrogridConfig :
4949 """Fixture to provide a valid MicrogridConfig instance."""
5050 # pylint: disable=protected-access
51- return MicrogridConfig ._load_table_entries (VALID_CONFIG )["1" ]
51+ return MicrogridConfig ._load_table_entries (VALID_CONFIG )[1 ]
5252
5353
5454def test_is_valid_type () -> None :
@@ -136,17 +136,17 @@ def test_load_configs(mocker: MockerFixture) -> None:
136136 mocker .patch ("pathlib.Path.is_file" , mocker .Mock (return_value = True ))
137137 configs = AssetsConfig .load_from_files (Path ("mock_path.toml" )).microgrids
138138
139- assert "1" in configs
140- assert configs ["1" ].meta is not None
141- assert configs ["1" ].meta .name == "Test Grid"
139+ assert 1 in configs
140+ assert configs [1 ].meta is not None
141+ assert configs [1 ].meta .name == "Test Grid"
142142
143- pv_config = configs ["1" ].pv
143+ pv_config = configs [1 ].pv
144144 assert pv_config is not None
145145 pv_system = pv_config .get ("PV1" )
146146 assert pv_system is not None
147147 assert pv_system .peak_power == 5000
148148
149- battery_config = configs ["1" ].battery
149+ battery_config = configs [1 ].battery
150150 assert battery_config is not None
151151 battery_system = battery_config .get ("BAT1" )
152152 assert battery_system is not None
@@ -194,8 +194,8 @@ def test_load_prefixed(tmp_path: Path, caplog: pytest.LogCaptureFixture) -> None
194194 _write (tmp_path , "prefixed.toml" , _PREFIXED_TOML )
195195 ).microgrids
196196
197- assert configs ["1" ].meta .name == "Test Grid"
198- assert configs ["1" ].component_type_ids ("pv" ) == [101 , 102 ]
197+ assert configs [1 ].meta .name == "Test Grid"
198+ assert configs [1 ].component_type_ids ("pv" ) == [101 , 102 ]
199199 assert "deprecated" not in caplog .text
200200
201201
@@ -206,7 +206,7 @@ def test_load_legacy_warns(tmp_path: Path, caplog: pytest.LogCaptureFixture) ->
206206 with caplog .at_level (logging .WARNING ):
207207 configs = AssetsConfig .load_from_files (path ).microgrids
208208
209- assert configs ["1" ].meta .name == "Test Grid"
209+ assert configs [1 ].meta .name == "Test Grid"
210210 assert "deprecated" in caplog .text
211211 assert str (path ) in caplog .text
212212
@@ -241,8 +241,8 @@ async def test_merge_prefixed_base_with_legacy_override(tmp_path: Path) -> None:
241241 await load_configs (default_files = base , override_files = override )
242242 ).microgrids
243243
244- assert configs ["1" ].meta .name == "Renamed"
245- assert configs ["1" ].component_type_ids ("pv" ) == [101 , 102 ]
244+ assert configs [1 ].meta .name == "Renamed"
245+ assert configs [1 ].component_type_ids ("pv" ) == [101 , 102 ]
246246
247247
248248def test_load_from_files_layers_fields (tmp_path : Path ) -> None :
@@ -257,8 +257,8 @@ def test_load_from_files_layers_fields(tmp_path: Path) -> None:
257257
258258 configs = AssetsConfig .load_from_files ([base , override ]).microgrids
259259
260- assert configs ["1" ].meta .name == "Renamed"
261- assert configs ["1" ].component_type_ids ("pv" ) == [101 , 102 ]
260+ assert configs [1 ].meta .name == "Renamed"
261+ assert configs [1 ].component_type_ids ("pv" ) == [101 , 102 ]
262262
263263
264264def test_assets_config_rejects_mismatched_id () -> None :
@@ -292,5 +292,5 @@ def test_assets_config_warns_on_unknown_entities(
292292 with caplog .at_level (logging .WARNING ):
293293 config = AssetsConfig .load_from_files (path )
294294
295- assert sorted (config .microgrids ) == ["1" ]
295+ assert sorted (config .microgrids ) == [1 ]
296296 assert "gridpool" in caplog .text
0 commit comments