def test_get_property_name_by_regex(self):
        class_alias_set = {'h0e2', 'h2ad', 'h987fcb', 'h15af36', }
        expected_property_name = 'color'
        class_parser = ClassPropertyParser(class_set=set())

        class_list = list(class_alias_set)
        for css_class in class_list:
            property_name = class_parser.get_property_name(css_class=css_class)
            self.assertEqual(property_name, expected_property_name, msg=css_class)
    def test_get_property_name_by_alias(self):
        class_alias_set = {'bold', 'bolder', 'lighter', 'fweight-200', 'f-weight-100', 'fw-bold', 'font-w-900', }
        expected_property_name = 'font-weight'
        class_parser = ClassPropertyParser(class_set=set())

        class_list = list(class_alias_set)
        for css_class in class_list:
            property_name = class_parser.get_property_name(css_class=css_class)
            self.assertEqual(property_name, expected_property_name, msg=css_class)
    def test_get_property_name_by_identical_name_valid(self):
        valid_identical_set = {'font-weight-bold', 'font-weight-700'}
        expected_property_name = 'font-weight'
        class_parser = ClassPropertyParser(class_set=valid_identical_set)

        class_list = list(class_parser.class_set)
        for i, css_class in enumerate(class_list):
            property_name = class_parser.get_property_name(css_class=css_class)
            self.assertEqual(property_name, expected_property_name)
 def test_get_property_name_non_matching(self):
     non_matching = ['not-a-property-', 'a-font-not-']
     expected_property_name = ''
     expected_empty_set = set()
     class_parser = ClassPropertyParser(class_set=set())
     for css_class in non_matching:
         property_name = class_parser.get_property_name(css_class=css_class)
         self.assertEqual(property_name, expected_property_name)
     self.assertEqual(class_parser.class_set, expected_empty_set)
    def test_get_property_name_by_identical_name_invalid(self):
        invalid_identical_set = [
            'font-weight', 'font-weight-', 'afont-weight-', '-font-weight', 'font%weight', 'fw-', '700'
        ]
        expected_property_name = ''
        expected_empty_set = set()
        class_parser = ClassPropertyParser(class_set=set())

        for css_class in invalid_identical_set:
            property_name = class_parser.get_property_name(css_class=css_class)
            self.assertEqual(property_name, expected_property_name)
        self.assertEqual(class_parser.class_set, expected_empty_set, msg=class_parser.class_set)