aboutsummaryrefslogtreecommitdiffstats
path: root/test/mitmproxy/addons/test_clientplayback.py
diff options
context:
space:
mode:
Diffstat (limited to 'test/mitmproxy/addons/test_clientplayback.py')
-rw-r--r--test/mitmproxy/addons/test_clientplayback.py10
1 files changed, 10 insertions, 0 deletions
diff --git a/test/mitmproxy/addons/test_clientplayback.py b/test/mitmproxy/addons/test_clientplayback.py
index 843d7409..7ffda317 100644
--- a/test/mitmproxy/addons/test_clientplayback.py
+++ b/test/mitmproxy/addons/test_clientplayback.py
@@ -48,6 +48,16 @@ class TestClientPlayback:
cp.stop_replay()
assert not cp.flows
+ def test_load_file(self, tmpdir):
+ cp = clientplayback.ClientPlayback()
+ with taddons.context():
+ fpath = str(tmpdir.join("flows"))
+ tdump(fpath, [tflow.tflow(resp=True)])
+ cp.load_file(fpath)
+ assert cp.flows
+ with pytest.raises(exceptions.CommandError):
+ cp.load_file("/nonexistent")
+
def test_configure(self, tmpdir):
cp = clientplayback.ClientPlayback()
with taddons.context() as tctx: