Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code

Delta Between Two Patch Sets: tests/crowdin_mock_api.py

Issue 29355396: Issue 4380 - Add Mock Crowdin API and Sync Test (Closed)
Left Patch Set: better assertions and expected request data added Created Oct. 19, 2016, 2:07 a.m.
Right Patch Set: formatting fix Created Oct. 25, 2016, 8:15 a.m.
Left:
Right:
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
Left: Side by side diff | Download
Right: Side by side diff | Download
« no previous file with change/comment | « tests/conftest.py ('k') | tests/expected_output/translate » ('j') | no next file with change/comment »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
LEFTRIGHT
1 from flask import Flask, send_from_directory, jsonify, request 1 from flask import Flask, send_from_directory, jsonify, request
2 2
3 app = Flask(__name__) 3 app = Flask(__name__)
4 app.request_log = [] 4 app.request_log = []
5 5
6 6
7 @app.before_request 7 @app.before_request
8 def log_request_info(): 8 def log_request_info():
9 log = (request.url, str(request.get_data())) 9 log = (request.url, str(request.get_data()))
10 app.request_log.append(log) 10 app.request_log.append(log)
(...skipping 94 matching lines...) Expand 10 before | Expand all | Expand 10 after
105 return jsonify() 105 return jsonify()
106 106
107 107
108 @app.route('/api/project/test/delete-file', methods=['POST']) 108 @app.route('/api/project/test/delete-file', methods=['POST'])
109 def delete_file(): 109 def delete_file():
110 return jsonify() 110 return jsonify()
111 111
112 112
113 @app.route('/api/project/test/export', methods=['GET']) 113 @app.route('/api/project/test/export', methods=['GET'])
114 def export(): 114 def export():
115 return jsonify( 115 return jsonify({'success': {'status': 'skipped'}})
Vasily Kuznetsov 2016/10/20 17:17:40 This could probably be one line.
116 {
117 'success': {
118 'status': 'skipped'
119 }
120 },
121 )
122 116
123 117
124 @app.route('/api/project/test/download/all.zip', methods=['GET']) 118 @app.route('/api/project/test/download/all.zip', methods=['GET'])
125 def get_zip(): 119 def get_zip():
126 return send_from_directory('', 'all.zip') 120 return send_from_directory('', 'all.zip')
LEFTRIGHT

Powered by Google App Engine
This is Rietveld