def _limit_max_file_size(f):
 @functools.wraps(f)
 def wrapper(*args, **kwargs):
  test_max_file_size = constraints.MAX_FILE_SIZE
  if (constraints.MAX_FILE_SIZE >= sys.maxsize):
   test_max_file_size = ((2 ** 30) + 2)
  with mock.patch.object(constraints, 'MAX_FILE_SIZE', test_max_file_size):
   return f(*args, **kwargs)
 return wrapper

def _limit_max_file_size ( f ) : @ functools . wraps ( f ) def wrapper ( * args , ** kwargs ) : test_max_file_size = constraints . MAX_FILE_SIZE if ( constraints . MAX_FILE_SIZE >= sys . maxsize ) : test_max_file_size = ( ( 2 ** 30 ) + 2 ) with mock . patch . object ( constraints , 'MAX_FILE_SIZE' , test_max_file_size ) : return f ( * args , ** kwargs ) return wrapper
this will limit constraints .