Lines Matching refs:wrapper

317     def check_wrapper(self, wrapper, wrapped,  argument
322 self.assertTrue(getattr(wrapper, name) is getattr(wrapped, name))
325 wrapper_attr = getattr(wrapper, name)
335 def wrapper(): function
337 functools.update_wrapper(wrapper, f)
338 return wrapper, f
341 wrapper, f = self._default_update()
342 self.check_wrapper(wrapper, f)
343 self.assertEqual(wrapper.__name__, 'f')
344 self.assertEqual(wrapper.attr, 'This is also a test')
349 wrapper, f = self._default_update()
350 self.assertEqual(wrapper.__doc__, 'This is a test')
357 def wrapper(): function
359 functools.update_wrapper(wrapper, f, (), ())
360 self.check_wrapper(wrapper, f, (), ())
361 self.assertEqual(wrapper.__name__, 'wrapper')
362 self.assertEqual(wrapper.__doc__, None)
363 self.assertFalse(hasattr(wrapper, 'attr'))
370 def wrapper(): function
372 wrapper.dict_attr = {}
375 functools.update_wrapper(wrapper, f, assign, update)
376 self.check_wrapper(wrapper, f, assign, update)
377 self.assertEqual(wrapper.__name__, 'wrapper')
378 self.assertEqual(wrapper.__doc__, None)
379 self.assertEqual(wrapper.attr, 'This is a different test')
380 self.assertEqual(wrapper.dict_attr, f.dict_attr)
385 def wrapper(): function
387 functools.update_wrapper(wrapper, max)
388 self.assertEqual(wrapper.__name__, 'max')
389 self.assertTrue(wrapper.__doc__.startswith('max('))
399 def wrapper(): function
401 self.check_wrapper(wrapper, f)
402 return wrapper
405 wrapper = self._default_update()
406 self.assertEqual(wrapper.__name__, 'f')
407 self.assertEqual(wrapper.attr, 'This is also a test')
412 wrapper = self._default_update()
413 self.assertEqual(wrapper.__doc__, 'This is a test')
421 def wrapper(): function
423 self.check_wrapper(wrapper, f, (), ())
424 self.assertEqual(wrapper.__name__, 'wrapper')
425 self.assertEqual(wrapper.__doc__, None)
426 self.assertFalse(hasattr(wrapper, 'attr'))
440 def wrapper(): function
442 self.check_wrapper(wrapper, f, assign, update)
443 self.assertEqual(wrapper.__name__, 'wrapper')
444 self.assertEqual(wrapper.__doc__, None)
445 self.assertEqual(wrapper.attr, 'This is a different test')
446 self.assertEqual(wrapper.dict_attr, f.dict_attr)