From 2c38fddea5eae0fe60822ee2fcf2565889f258b9 Mon Sep 17 00:00:00 2001 From: Matthew Shao Date: Sun, 21 May 2017 20:59:19 +0800 Subject: [web] TFlow minor improved. --- test/mitmproxy/tools/web/test_app.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'test') diff --git a/test/mitmproxy/tools/web/test_app.py b/test/mitmproxy/tools/web/test_app.py index 8a81e0e0..f6072efb 100644 --- a/test/mitmproxy/tools/web/test_app.py +++ b/test/mitmproxy/tools/web/test_app.py @@ -281,7 +281,8 @@ class TestApp(tornado.testing.AsyncHTTPTestCase): tflow_json = _json.dumps( app.flow_to_json(tflow.tflow(resp=True, err=True)), indent=4, sort_keys=True ) - web_root = os.path.join(os.getcwd(), 'web') + here = os.path.abspath(os.path.dirname(__file__)) + web_root = os.path.join(here, os.pardir, os.pardir, os.pardir, os.pardir, 'web') tflow_path = os.path.join(web_root, 'src/js/__tests__/ducks/_tflow.js') content = """export default function(){{\n return {tflow_json}\n}}""".format(tflow_json=tflow_json) with open(tflow_path, 'w') as f: -- cgit v1.2.3