aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMaximilian Hils <git@maximilianhils.com>2017-02-09 14:21:25 +0100
committerMaximilian Hils <git@maximilianhils.com>2017-02-09 14:21:25 +0100
commit7a205e80aa94600291f87c96e51f13abe9fb4703 (patch)
treeb78816e786943190292911b3fe0bc13a1da46602
parentfa661217c12733da4afe500b51a253f5994f3506 (diff)
downloadmitmproxy-7a205e80aa94600291f87c96e51f13abe9fb4703.tar.gz
mitmproxy-7a205e80aa94600291f87c96e51f13abe9fb4703.tar.bz2
mitmproxy-7a205e80aa94600291f87c96e51f13abe9fb4703.zip
improve stateobject tests
-rw-r--r--test/mitmproxy/test_stateobject.py8
1 files changed, 7 insertions, 1 deletions
diff --git a/test/mitmproxy/test_stateobject.py b/test/mitmproxy/test_stateobject.py
index b9ffe7ae..edec92c2 100644
--- a/test/mitmproxy/test_stateobject.py
+++ b/test/mitmproxy/test_stateobject.py
@@ -17,6 +17,9 @@ class Child(StateObject):
obj.set_state(state)
return obj
+ def __eq__(self, other):
+ return isinstance(other, Child) and self.x == other.x
+
class Container(StateObject):
def __init__(self):
@@ -60,4 +63,7 @@ def test_container_list():
"child": None,
"children": [{"x": 42}, {"x": 44}]
}
- assert len(a.copy().children) == 2
+ copy = a.copy()
+ assert len(copy.children) == 2
+ assert copy.children is not a.children
+ assert copy.children[0] is not a.children[0]