예제 #1
0
파일: test_util.py 프로젝트: Adniel/zato
 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)
예제 #2
0
    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)
예제 #3
0
파일: __init__.py 프로젝트: ibeex/zato
 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)
예제 #4
0
    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)
예제 #5
0
 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)