def get_name(cls): if hasattr(cls, 'role_name'): return cls.role_name return camelToSnake(cls.__name__)
def test_camel_to_snake(self): self.assertEqual(camelToSnake('camelCaseString'), 'camel_case_string') self.assertEqual(camelToSnake('Snake_Camel_String'), 'snake__camel__string')