def visit_ClassDef(self, node): if not self.CRE_FORMATS['pascal_case'].match(node.name.value): self.add_error('invalid-class-name', node=node.name, args=(node.name.value, 'pascal_case')) if camelize(self.source.basename) != node.name.value: self.add_error('mismatched-class-name', node=node.name, args=(node.name.value, self.source.filename))
def test_kebabize_revert(self): assert camelize(kebabize('varName')) == 'varName'
def test_snakeize_revert(self): assert camelize(snakeize('specialGuest')) == 'specialGuest'
def test_pascalcase_and_acronyms(self): assert camelize('StringIO', acronyms=['IO']) == 'stringIO'
def test_camelcase_and_acronyms(self): assert camelize('currentThread', acronyms=['THREAD']) == 'currentTHREAD'
def test_kebabcase_and_acronyms(self): assert camelize('long-url-path', acronyms=['URL']) == 'longURLPath'
def test_camelize_revert(self): assert kebabize(camelize('current-thread')) == 'current-thread'
def test_snakecase(self): assert camelize('var_name') == 'varName'
def test_dunder_name(self): assert camelize('__dunder_name__') == '__dunderName__'
def test_protected_name(self): assert camelize('_protected_name') == '_protectedName'
def test_pascalcase(self): assert camelize('StringIO') == 'stringIo'
def test_camelcase(self): assert camelize('currentThread') == 'currentThread'
def test_kebabcase(self): assert camelize('long-url-path') == 'longUrlPath'
def test_pascalize_revert(self): assert camelize(pascalize('stringIo')) == 'stringIo'
def test_lowercase_and_acronyms(self): assert camelize('stringio', acronyms=['IO']) == 'stringIO'
def test_lowercase(self): assert camelize('stringio') == 'stringio'
def test_snakecase_and_acronyms(self): assert camelize('var_name', acronyms=['VA']) == 'VARName'
def test_camelize_revert(self): assert pascalize(camelize('CurrentThread')) == 'CurrentThread'
def test_camelize_revert(self): assert snakeize(camelize('current_thread')) == 'current_thread'