diff options
author | Aldo Cortesi <aldo@nullcube.com> | 2012-10-29 15:16:44 +1300 |
---|---|---|
committer | Aldo Cortesi <aldo@nullcube.com> | 2012-10-29 15:16:44 +1300 |
commit | 8741600ce770ac949550a3d7f3eac7cbbfd7456e (patch) | |
tree | 2e1faaba4eb6b14ee6f52d817495f2d05246c271 /test/test_language.py | |
parent | 882969086cf3e1277360bcd49588592f99c575bf (diff) | |
download | mitmproxy-8741600ce770ac949550a3d7f3eac7cbbfd7456e.tar.gz mitmproxy-8741600ce770ac949550a3d7f3eac7cbbfd7456e.tar.bz2 mitmproxy-8741600ce770ac949550a3d7f3eac7cbbfd7456e.zip |
Refactoring: canonical storage of a message is now the sequence of tokens that defines it.
We use a set of accessor properties to ease access to tokens. We can now ditch
the .accept() methods.
Diffstat (limited to 'test/test_language.py')
-rw-r--r-- | test/test_language.py | 30 |
1 files changed, 9 insertions, 21 deletions
diff --git a/test/test_language.py b/test/test_language.py index cb7d7d1b..009f4ddd 100644 --- a/test/test_language.py +++ b/test/test_language.py @@ -542,32 +542,20 @@ class TestResponse: testlen(language.parse_response({}, "400:m'msg':h'foo'='bar':b@100b")) def test_maximum_length(self): - def testlen(x, actions): + def testlen(x): s = cStringIO.StringIO() m = x.maximum_length({}, None) x.serve(s, {}) assert m >= len(s.getvalue()) - r = language.parse_response({}, "400:m'msg':b@100") - - actions = [ - language.DisconnectAt(0) - ] - r.actions = actions - testlen(r, actions) - - actions = [ - language.DisconnectAt(0), - language.InjectAt(0, language.ValueLiteral("foo")) - ] - r.actions = actions - testlen(r, actions) - - actions = [ - language.InjectAt(0, language.ValueLiteral("foo")) - ] - r.actions = actions - testlen(r, actions) + r = language.parse_response({}, "400:m'msg':b@100:d0") + testlen(r) + + r = language.parse_response({}, "400:m'msg':b@100:d0:i0,'foo'") + testlen(r) + + r = language.parse_response({}, "400:m'msg':b@100:d0:i0,'foo'") + testlen(r) def test_render(self): r = language.parse_response({}, "400:p0,100:dr") |