def test_uncamelify(self): original = 'ILikeToReadWSDLDocsNotReallyNOPENotMeQ' expected1 = 'i-like-to-read-wsdl-docs-not-really-nope-not-me-q' expected2 = 'I_LIKE_TO_READ_WSDL_DOCS_NOT_REALLY_NOPE_NOT_ME_Q' self.assertEquals(util.uncamelify(original), expected1) self.assertEquals(util.uncamelify(original, '_', unicode.upper), expected2)
def convert_impl_name(name): # TODO: Move the replace functionality over to uncamelify, possibly modifying its regexp split = uncamelify(name).split('.') path, class_name = split[:-1], split[-1] path = [elem.replace('_', '-') for elem in path] class_name = class_name[1:] if class_name.startswith('-') else class_name class_name = class_name.replace('.-', '.').replace('_-', '_') return '{}.{}'.format('.'.join(path), class_name)
def test_uncamelify(self): original = 'ILikeToReadWSDLDocsNotReallyNOPENotMeQ' expected1 = 'i-like-to-read-wsdl-docs-not-really-nope-not-me-q' self.assertEquals(util.uncamelify(original), expected1)