joey shelton / LED_Demo

Dependencies:   MAX44000 PWM_Tone_Library nexpaq_mdk

Fork of LED_Demo by Maxim nexpaq

Embed: (wiki syntax)

« Back to documentation index

Show/hide line numbers test_data.py Source File

test_data.py

00001 # Test for configuration data defined in targets
00002 # A base target (B1) defines 3 configuration parameters (base1_1, base1_2 and base1_3)
00003 # A derived target (D1) inherits drom B1 and defines one configuration parameters (derived1 and derived2) and overrides base1_1 and base1_2
00004 # Another base target (B2) defines its own configuration parameters (base2_1 and base2_2)
00005 # The final target F derives from B2 and D1, defines two configuration paramaters (f1_1 and f1_2)
00006 # and overrides base2_1, base1_1, derived2 and its own configuration parameter f1_1 (which is legal)
00007 # Final result:
00008 #     base1_1 must have the value defined in F
00009 #     base1_2 must have the value defined in D1
00010 #     base1_3 must have the value defined in B1
00011 #     derived1 must have the value defined in D1
00012 #     derived2 must have the value defined in F
00013 #     base2_1 must have the value defined in F
00014 #     base2_2 must have the value defined in B2
00015 #     f1_1 must have the value defined and then overriden in F
00016 #     f1_2 must have the value defined in F
00017 
00018 expected_results = {
00019     "f": {
00020         "desc": "test multiple target inheritance",
00021         "target.base1_1": "v_base1_1_f",
00022         "target.base1_2": "v_base1_2_d1",
00023         "target.base1_3": "v_base1_3_b1",
00024         "target.derived1": "v_derived1_d1",
00025         "target.derived2": "v_derived2_f",
00026         "target.base2_1": "v_base2_1_f",
00027         "target.base2_2": "v_base2_2_b2",
00028         "target.f1_1": "v_f1_1_f_override",
00029         "target.f1_2": "v_f1_2_f"
00030     },
00031     "b1": {
00032         "desc": "test with a single base target, no inheritance",
00033         "target.base1_1": "v_base1_1_b1",
00034         "target.base1_2": "v_base1_2_b1",
00035         "target.base1_3": "v_base1_3_b1"
00036     },
00037     "d1": {
00038         "desc": "test single target inheritance",
00039         "target.base1_1": "v_base1_1_d1",
00040         "target.base1_2": "v_base1_2_d1",
00041         "target.base1_3": "v_base1_3_b1",
00042         "target.derived1": "v_derived1_d1",
00043         "target.derived2": "v_derived2_d1"
00044     }
00045 }
00046