Mercurial > hg > pyloader
diff tests/objects.py @ 55:49f88cde6219
make the test wrapper more interesting (and testable)
author | Jeff Hammel <jhammel@mozilla.com> |
---|---|
date | Wed, 08 Jun 2011 23:35:56 -0700 |
parents | f6616a5f468f |
children | cb1898f8c72a |
line wrap: on
line diff
--- a/tests/objects.py Wed Jun 08 23:29:50 2011 -0700 +++ b/tests/objects.py Wed Jun 08 23:35:56 2011 -0700 @@ -22,13 +22,15 @@ return number * self.factor class Wrapper(object): - def __init__(self, app): + def __init__(self, app, **values): self.app = app + self.values = dict([(int(i), j) for i, j in values]) def __call__(self, *args, **kwargs): retval = self.app(*args, **kwargs) values = {1: 'one', 2: 'two', 3: 'three'} # etc + values.update(self.values) if retval in values: return values[retval] return retval