def get_name(cls):
        if hasattr(cls, 'role_name'):
            return cls.role_name

        return camelToSnake(cls.__name__)
    def get_name(cls):
        if hasattr(cls, 'role_name'):
            return cls.role_name

        return camelToSnake(cls.__name__)
Exemple #3
0
 def test_camel_to_snake(self):
     self.assertEqual(camelToSnake('camelCaseString'), 'camel_case_string')
     self.assertEqual(camelToSnake('Snake_Camel_String'),
                      'snake__camel__string')
 def test_camel_to_snake(self):
     self.assertEqual(camelToSnake('camelCaseString'), 'camel_case_string')
     self.assertEqual(camelToSnake('Snake_Camel_String'), 'snake__camel__string')