changeset 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 f724db086125
children ade85970c628
files tests/objects.py
diffstat 1 files changed, 3 insertions(+), 1 deletions(-) [+]
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