@classmethod
    def setUpClass(kls):
        factory = SwaggerPrimitive()
        def decode_int(obj, val, ctx):
            # minus 1
            return 1 - int(val)

        def decode_str(obj, val, ctx):
            # remove the last char
            return str(val)[:-1]

        def str_no_validate(obj, val, ctx):
            # same as the one used in pyswagger, but no validation
            return str(val)

        factory.register('encoded_integer', None, decode_int)
        factory.register('string', 'special_encoded', decode_str)
        factory.register('string', None, str_no_validate, _2nd_pass=None)

        kls.app = SwaggerApp.load(get_test_data_folder(
            version='2.0',
            which=os.path.join('schema', 'extension'),
        ), prim=factory)
        kls.app.prepare()
dataset/ETHPy150Open mission-liao/pyswagger/pyswagger/tests/v2_0/test_prim.py/PrimitiveExtensionTestCase.setUpClass/swapped operands of `-`