Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
@loaded()
def func2(c1, c2: C):
self.assertEqual(c1['x'], 'c1')
self.assertEqual(c2.x, 'c2')
return jsons.dump(C('c_res'))
@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'))
@loaded(loader=jsons.loads)
def func_s(c: C) -> C:
self.assertEqual(c.x, 'c1')
return '{"x": "res1"}'
@loaded(loader=jsons.loadb)
def func_b(c: C) -> C:
self.assertEqual(c.x, 'c2')
return b'{"x": "res2"}'
@loaded(loader=jsons.loadb)
def func_b(c: C) -> C:
self.assertEqual(c.x, 'c2')
return b'{"x": "res2"}'
@loaded(returnvalue=False)
def func(x):
return x
arg = '2018-10-07T19:45:00+02:00'
@loaded()
def func2(c1, c2: C):
self.assertEqual(c1['x'], 'c1')
self.assertEqual(c2.x, 'c2')
return jsons.dump(C('c_res'))
@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'))
@loaded(returnvalue=False)
def func(x):
return x
arg = '2018-10-07T19:45:00+02:00'
@loaded(loader=jsons.loads)
def func_s(c: C) -> C:
self.assertEqual(c.x, 'c1')
return '{"x": "res1"}'