summaryrefslogtreecommitdiff
path: root/tests/vm_diagnostics_acceptance.py
diff options
context:
space:
mode:
Diffstat (limited to 'tests/vm_diagnostics_acceptance.py')
-rw-r--r--tests/vm_diagnostics_acceptance.py7
1 files changed, 6 insertions, 1 deletions
diff --git a/tests/vm_diagnostics_acceptance.py b/tests/vm_diagnostics_acceptance.py
index 1984585..001f1a3 100644
--- a/tests/vm_diagnostics_acceptance.py
+++ b/tests/vm_diagnostics_acceptance.py
@@ -75,9 +75,14 @@ def main(binary):
self.send_response(206); self.end_headers(); self.wfile.write(b'partial'); return
self.send_response(200)
if self.path == '/error': self.send_header('Content-Type', 'application/problem+json')
- if self.path == '/json-error': self.send_header('Content-Type', 'application/json')
+ if self.path in ['/json-error', '/long-error', '/late-error', '/escaped-error', '/json-data']: self.send_header('Content-Type', 'application/json')
body = b''
if self.path in ['/error', '/json-error']: body = b'{"error":"fixture-provider-error"}'
+ if self.path == '/long-error': body = json.dumps({'error':'x'*30000}).encode()
+ if self.path == '/late-error': body = json.dumps({'metadata':'x'*30000, 'error':'provider failure'}).encode()
+ if self.path == '/escaped-error': body = b'{"\\u0065rror":"' + b'x'*20000 + b'"}'
+ if self.path == '/json-data': body = json.dumps({'data':{'error':'nested payload'},'metadata':'x'*30000 + '"error":not a field', 'error':None,'errors':[]}).encode()
+ if self.path == '/late-html': body = b' ' * 30000 + b'<html>provider error</html>'
if self.path == '/html': body = b'<html>unexpected page</html>'
if self.path == '/oversize': body = b'x' * 4097
if self.path == '/large': body = b'x' * (8 * 1048576)