comparison tests/objects.py @ 60:cc361ad8a692

stub out future directions for decorators and their testing a bit
author Jeff Hammel <jhammel@mozilla.com>
date Thu, 09 Jun 2011 09:07:08 -0700
parents 2a1648a53857
children 20bdb8125817
comparison
equal deleted inserted replaced
59:6b48dee5b92b 60:cc361ad8a692
22 return number * self.factor 22 return number * self.factor
23 23
24 class Wrapper(object): 24 class Wrapper(object):
25 def __init__(self, app, **values): 25 def __init__(self, app, **values):
26 self.app = app 26 self.app = app
27 self.values = dict([(int(i), j) for i, j in values]) # TODO: should be automagically converted ideally via pyloader 27 self.values = dict([(int(j), i) for i, j in values]) # TODO: should be automagically converted ideally via pyloader
28 def __call__(self, *args, **kwargs): 28 def __call__(self, *args, **kwargs):
29 retval = self.app(*args, **kwargs) 29 retval = self.app(*args, **kwargs)
30 values = {1: 'one', 30 values = {1: 'one',
31 2: 'two', 31 2: 'two',
32 3: 'three'} # etc 32 3: 'three'} # etc