comparison MoinMoin/support/werkzeug/test.py @ 4614:159902268129

upgraded werkzeug
author Thomas Waldmann <tw AT waldmann-edv DOT de>
date Sun, 01 Mar 2009 03:18:57 +0100
parents 246ba4eecab2
children c404a1295318
comparison
equal deleted inserted replaced
4613:e7f1cf9eeb96 4614:159902268129
276 self.multiprocess = multiprocess 276 self.multiprocess = multiprocess
277 self.run_once = run_once 277 self.run_once = run_once
278 self.environ_base = environ_base 278 self.environ_base = environ_base
279 self.environ_overrides = environ_overrides 279 self.environ_overrides = environ_overrides
280 self.input_stream = input_stream 280 self.input_stream = input_stream
281 self.content_length = content_length
281 self.closed = False 282 self.closed = False
282 283
283 if data: 284 if data:
284 if input_stream is not None: 285 if input_stream is not None:
285 raise TypeError('can\'t provide input stream and data') 286 raise TypeError('can\'t provide input stream and data')
362 363
363 def _get_content_length(self): 364 def _get_content_length(self):
364 return self.headers.get('Content-Length', type=int) 365 return self.headers.get('Content-Length', type=int)
365 366
366 def _set_content_length(self, value): 367 def _set_content_length(self, value):
367 self.headers['Content-Length'] = str(value) 368 if value is None:
369 self.headers.pop('Content-Length', None)
370 else:
371 self.headers['Content-Length'] = str(value)
368 372
369 content_length = property(_get_content_length, _set_content_length, doc=''' 373 content_length = property(_get_content_length, _set_content_length, doc='''
370 The content length as integer. Reflected from and to the 374 The content length as integer. Reflected from and to the
371 :attr:`headers`. Do not set if you set :attr:`files` or 375 :attr:`headers`. Do not set if you set :attr:`files` or
372 :attr:`form` for auto detection.''') 376 :attr:`form` for auto detection.''')