aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorThomas Kriechbaumer <thomas@kriechbaumer.name>2017-02-08 17:37:08 +0100
committerThomas Kriechbaumer <thomas@kriechbaumer.name>2017-02-09 16:08:36 +0100
commitf6cea09d5a6a5b63eafaccec9f6100584865999b (patch)
tree03856304aae39bb9f02cd65e0fa41ae2dbe3dabe
parent1847cf175c8a45359eef08f5cf2bfc414b059dbe (diff)
downloadmitmproxy-f6cea09d5a6a5b63eafaccec9f6100584865999b.tar.gz
mitmproxy-f6cea09d5a6a5b63eafaccec9f6100584865999b.tar.bz2
mitmproxy-f6cea09d5a6a5b63eafaccec9f6100584865999b.zip
stateobject: coverage++
-rw-r--r--test/mitmproxy/test_stateobject.py12
1 files changed, 12 insertions, 0 deletions
diff --git a/test/mitmproxy/test_stateobject.py b/test/mitmproxy/test_stateobject.py
index edec92c2..7b8e30d0 100644
--- a/test/mitmproxy/test_stateobject.py
+++ b/test/mitmproxy/test_stateobject.py
@@ -1,4 +1,5 @@
from typing import List
+import pytest
from mitmproxy.stateobject import StateObject
@@ -67,3 +68,14 @@ def test_container_list():
assert len(copy.children) == 2
assert copy.children is not a.children
assert copy.children[0] is not a.children[0]
+
+
+def test_too_much_state():
+ a = Container()
+ a.child = Child(42)
+ s = a.get_state()
+ s['foo'] = 'bar'
+ b = Container()
+
+ with pytest.raises(RuntimeWarning):
+ b.set_state(s)