Skip to content

Commit 49a178e

Browse files
James Boultonclaude
andcommitted
load_config: key the Map config class by MAP
CONFIG_INSTANCE_DICT had "Map", unlike the CFG type and CONTROL_INSTANCE_DICT. A test now keeps the two dicts' keys the same. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
1 parent 213eeba commit 49a178e

2 files changed

Lines changed: 5 additions & 1 deletion

File tree

‎dashio/load_config.py‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@
8484
"DIR": DirectionConfig,
8585
"LOG": ControlConfig,
8686
"LBL": ControlConfig,
87-
"Map": ControlConfig,
87+
"MAP": ControlConfig,
8888
"TBL": TableConfig
8989
}
9090

‎tests/test_cfg_round_trip.py‎

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22

33
from dashio import Button, Color, ColorPicker, ColorPickerStyle, ControlPosition, Table
44
from dashio.iotcontrol.control import _get_color
5+
from dashio.load_config import CONFIG_INSTANCE_DICT, CONTROL_INSTANCE_DICT
56

67

78
class TestCfgRoundTrip(unittest.TestCase):
@@ -46,6 +47,9 @@ def test_table_without_column_headings(self):
4647
cfg["parentID"] = "VIEW1"
4748
self.assertEqual(Table.from_cfg_dict(cfg).get_cfg64([])[0]["columns"], 3, "columns should survive a round trip")
4849

50+
def test_config_instance_dict_matches_control_types(self):
51+
self.assertEqual(set(CONFIG_INSTANCE_DICT), set(CONTROL_INSTANCE_DICT), "Every control type should have a config class, keyed by its CFG type")
52+
4953

5054
if __name__ == '__main__':
5155
unittest.main()

0 commit comments

Comments
 (0)