equal
deleted
inserted
replaced
143 :param *expected: parameters (eg `basestring`) which are expected to be |
143 :param *expected: parameters (eg `basestring`) which are expected to be |
144 found in named arguments (kwargs) |
144 found in named arguments (kwargs) |
145 """ |
145 """ |
146 def __init__(self, *expected): |
146 def __init__(self, *expected): |
147 self.expected = expected |
147 self.expected = expected |
148 if len(expected) == 1: |
148 # if len(expected) == 1: |
149 try: |
149 # try: |
150 iter(expected[0]) |
150 # iter(expected[0]) |
151 self.expected = expected[0] |
151 # self.expected = expected[0] |
152 except TypeError: |
152 # except TypeError: |
153 pass |
153 # pass |
154 |
154 |
155 @lltrace |
155 @lltrace |
156 def __call__(self, cls, req, *args, **kwargs): |
156 def __call__(self, cls, req, *args, **kwargs): |
157 return kwargs.get('rtype') in self.expected |
157 return kwargs.get('rtype') in self.expected |
158 |
158 |