Esempio n. 1
0
 def test_merge_dictionaries(self):
     data_library2 = DataLibrary()
     full_dict = {
         'background': {'bg-', },
         'background-color': set(),
         'color': {'c-', },
         'font-size': {'fsize-', 'f-size-', },
         'font-weight': {'bold', 'bolder', 'lighter', 'fweight-', 'f-weight-', },
         'height': {'h-', },
         'margin': {'m-', },
     }
     value_as_dict = {
         'color': {'col-', },
         'margin': {'mar-', },
     }
     settings_custom_alias_dict = {
         'background-color': {'bgc-', 'bg-c-', 'bg-color-', },
         'color': {'coco-', },
     }
     expected_dict = {
         'background': {'bg-', },
         'background-color': {'bgc-', 'bg-c-', 'bg-color-', },
         'color': {'c-', 'col-', 'coco-', },
         'font-size': {'fsize-', 'f-size-', },
         'font-weight': {'bold', 'bolder', 'lighter', 'fweight-', 'f-weight-', },
         'height': {'h-', },
         'margin': {'m-', 'mar-', },
     }
     data_library2.property_alias_dict = full_dict
     data_library2.property_value_as_alias_dict = value_as_dict
     data_library2.custom_property_alias_dict = settings_custom_alias_dict
     data_library2.merge_dictionaries()
     self.assertEqual(data_library2.property_alias_dict, expected_dict)
Esempio n. 2
0
 def test_merge_dictionaries_empty_custom_dict(self):
     data_library2 = DataLibrary()
     dict1 = {'font-size': {'fsize-', 'f-size-', }, }
     value_as_dict = None
     data_library2.property_alias_dict = dict1
     data_library2.property_value_as_alias_dict = value_as_dict
     data_library2.custom_property_alias_dict = None
     data_library2.merge_dictionaries()
     self.assertEqual(data_library2.property_alias_dict, dict1)