Skip to content

Commit 9f7d710

Browse files
committed
repair previous
1 parent 21051c9 commit 9f7d710

File tree

1 file changed

+16
-8
lines changed

1 file changed

+16
-8
lines changed

tests/test_mig_wsgi-bin_migwsgi.py

Lines changed: 16 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -148,16 +148,23 @@ def _instrumented_format_output(
148148

149149

150150
def create_instrumented_retrieve_handler():
151-
def _instrumented_retrieve_handler(*args):
152-
_instrumented_retrieve_handler.calls.append(tuple(args))
153-
return _instrumented_retrieve_handler.returning or ([], returnvalues.ERROR)
154-
def _program(output_objects=None, return_value=None):
151+
def _simulated_action(*args):
152+
return _simulated_action.returning or ([], returnvalues.ERROR)
153+
_simulated_action.calls = []
154+
_simulated_action.returning = None
155+
156+
def _program_response(output_objects=None, return_value=None):
155157
assert _is_return_value(return_value), "return value must be present in returnvalues"
156158
assert isinstance(output_objects, list)
157-
_instrumented_retrieve_handler.returning = (output_objects, return_value)
159+
_simulated_action.returning = (output_objects, return_value)
160+
161+
def _instrumented_retrieve_handler(*args):
162+
_instrumented_retrieve_handler.calls.append(tuple(args))
163+
return _simulated_action
158164
_instrumented_retrieve_handler.calls = []
159-
_instrumented_retrieve_handler.returning = None
160-
_instrumented_retrieve_handler.program = _program
165+
166+
_instrumented_retrieve_handler.program = _program_response
167+
_instrumented_retrieve_handler.simulated = _simulated_action
161168

162169
return _instrumented_retrieve_handler
163170

@@ -178,7 +185,8 @@ def noop(*args):
178185

179186
class MigWsgi_binMigwsgi(MigTestCase):
180187
def assertInstrumentation(self):
181-
self.assertIsNotNone(self.instrumented_retrieve_handler.returning, "no response programmed")
188+
simulated_action = self.instrumented_retrieve_handler.simulated
189+
self.assertIsNotNone(simulated_action.returning, "no response programmed")
182190

183191
def was_called(fake):
184192
assert hasattr(fake, 'calls')

0 commit comments

Comments
 (0)