Skip to content

Commit 60c27e5

Browse files
- 4 failing.
1 parent 9d5de76 commit 60c27e5

File tree

1 file changed

+12
-5
lines changed

1 file changed

+12
-5
lines changed

test/python/flask/gcp/app.py

Lines changed: 12 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -214,13 +214,20 @@ def projects_testing_project_global_firewalls_some_other_firewall():
214214
def projects_testing_project_global_firewalls():
215215
return render_template('route_35_template.json'), 200, {'Content-Type': 'application/json'}
216216

217-
@app.route('/projects/changing-project/global/firewalls', methods=['GET'])
218-
def projects_changing_project_global_firewalls():
219-
return render_template('route_36_template.json'), 200, {'Content-Type': 'application/json'}
217+
218+
# Initialize a counter to track the number of calls
219+
call_counter = {"firewalls": 0}
220220

221221
@app.route('/projects/changing-project/global/firewalls', methods=['GET'])
222-
def projects_changing_project_global_firewalls_02(): # had to manually rename
223-
return render_template('route_37_template.json'), 200, {'Content-Type': 'application/json'}
222+
def firewalls():
223+
# Increment the call counter
224+
call_counter["firewalls"] += 1
225+
226+
# Determine the response based on the call count
227+
if call_counter["firewalls"] <= 2:
228+
return render_template('route_36_template.json'), 200, {'Content-Type': 'application/json'}
229+
else:
230+
return render_template('route_37_template.json'), 200, {'Content-Type': 'application/json'}
224231

225232
if __name__ == '__main__':
226233
app.run(debug=True)

0 commit comments

Comments
 (0)