How to use the jsons.decorators.loaded function in jsons

To help you get started, we’ve selected a few jsons examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github ramonhagenaars / jsons / test_jsons.py View on Github external
        @loaded()
        def func2(c1, c2: C):
            self.assertEqual(c1['x'], 'c1')
            self.assertEqual(c2.x, 'c2')
            return jsons.dump(C('c_res'))
github ramonhagenaars / jsons / tests / test_decorator.py View on Github external
        @loaded(returnvalue=False)
        def func3(c1, c2: C) -> C:
            self.assertEqual(c1['x'], 'c1')
            self.assertEqual(c2.x, 'c2')
            return jsons.dump(C('c_res'))
github ramonhagenaars / jsons / test_jsons.py View on Github external
        @loaded(loader=jsons.loads)
        def func_s(c: C) -> C:
            self.assertEqual(c.x, 'c1')
            return '{"x": "res1"}'
github ramonhagenaars / jsons / tests / test_decorator.py View on Github external
        @loaded(loader=jsons.loadb)
        def func_b(c: C) -> C:
            self.assertEqual(c.x, 'c2')
            return b'{"x": "res2"}'
github ramonhagenaars / jsons / test_jsons.py View on Github external
        @loaded(loader=jsons.loadb)
        def func_b(c: C) -> C:
            self.assertEqual(c.x, 'c2')
            return b'{"x": "res2"}'
github ramonhagenaars / jsons / tests / test_decorator.py View on Github external
        @loaded(returnvalue=False)
        def func(x):
            return x
        arg = '2018-10-07T19:45:00+02:00'
github ramonhagenaars / jsons / tests / test_decorator.py View on Github external
        @loaded()
        def func2(c1, c2: C):
            self.assertEqual(c1['x'], 'c1')
            self.assertEqual(c2.x, 'c2')
            return jsons.dump(C('c_res'))
github ramonhagenaars / jsons / test_jsons.py View on Github external
        @loaded(parameters=False)
        def func4(c1, c2: C) -> C:
            self.assertEqual(c1['x'], 'c1')
            self.assertEqual(c2['x'], 'c2')
            return jsons.dump(C('c_res'))
github ramonhagenaars / jsons / test_jsons.py View on Github external
        @loaded(returnvalue=False)
        def func(x):
            return x
        arg = '2018-10-07T19:45:00+02:00'
github ramonhagenaars / jsons / tests / test_decorator.py View on Github external
        @loaded(loader=jsons.loads)
        def func_s(c: C) -> C:
            self.assertEqual(c.x, 'c1')
            return '{"x": "res1"}'