From ac335057a7829e2972ab6af56fa1d977623d5426 Mon Sep 17 00:00:00 2001 From: Aldo Cortesi Date: Sun, 17 Dec 2017 10:17:05 +1300 Subject: [PATCH] Disable implicit JS test asset generation The JS test assets depend in a brittle way on the details of the tflow() utility functions. We shouldn't have to fix JS tests when adjusting these. Options: - Manually generate the test assets in a script. - Define the JS assets without using tflow, so they don't unexpextedly vary. --- test/mitmproxy/tools/web/test_app.py | 2 +- web/src/js/__tests__/ducks/_tflow.js | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/test/mitmproxy/tools/web/test_app.py b/test/mitmproxy/tools/web/test_app.py index 248581b95..5afc0bcae 100644 --- a/test/mitmproxy/tools/web/test_app.py +++ b/test/mitmproxy/tools/web/test_app.py @@ -322,7 +322,7 @@ class TestApp(tornado.testing.AsyncHTTPTestCase): ws_client2 = yield websocket.websocket_connect(ws_url) ws_client2.close() - def test_generate_tflow_js(self): + def _test_generate_tflow_js(self): _tflow = app.flow_to_json(tflow.tflow(resp=True, err=True)) # Set some value as constant, so that _tflow.js would not change every time. _tflow['client_conn']['id'] = "4a18d1a0-50a1-48dd-9aa6-d45d74282939" diff --git a/web/src/js/__tests__/ducks/_tflow.js b/web/src/js/__tests__/ducks/_tflow.js index 8599200de..44b323427 100644 --- a/web/src/js/__tests__/ducks/_tflow.js +++ b/web/src/js/__tests__/ducks/_tflow.js @@ -45,8 +45,8 @@ export default function(){ "port": 22, "pretty_host": "address", "scheme": "http", - "timestamp_end": 2, - "timestamp_start": 1 + "timestamp_end": null, + "timestamp_start": null }, "response": { "contentHash": "ab530a13e45914982b79f9b7e3fba994cfd1f3fb22f71cea1afbf02b460c6d1d",