diff options
author | Aldo Cortesi <aldo@nullcube.com> | 2011-02-24 10:33:39 +1300 |
---|---|---|
committer | Aldo Cortesi <aldo@nullcube.com> | 2011-02-24 10:33:39 +1300 |
commit | 57947b328ec0faba24e4682f7e4cb9074b81b684 (patch) | |
tree | 047584b734a99c84f2a98db6f379b0fb6f98025b /test | |
parent | 3c1db00ebb2aa0596840cda6a60e2af3d11a656b (diff) | |
download | mitmproxy-57947b328ec0faba24e4682f7e4cb9074b81b684.tar.gz mitmproxy-57947b328ec0faba24e4682f7e4cb9074b81b684.tar.bz2 mitmproxy-57947b328ec0faba24e4682f7e4cb9074b81b684.zip |
Start abstracting out sticky cookie state.
Diffstat (limited to 'test')
-rw-r--r-- | test/test_flow.py | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/test/test_flow.py b/test/test_flow.py index e574f545..f58b1dd0 100644 --- a/test/test_flow.py +++ b/test/test_flow.py @@ -4,6 +4,17 @@ import utils import libpry +class uStickyCookieState(libpry.AutoTree): + def test_simple(self): + s = flow.StickyCookieState() + s.add_cookies( + ["SSID=mooo, FOO=bar; Domain=.google.com; Path=/; Expires=Wed, 13-Jan-2021 22:23:01 GMT; Secure; "] + ) + assert len(s.jar) == 1 + assert len(s.get_cookies("www.google.com", "/foo")) == 1 + assert len(s.get_cookies("www.foo.com", "/foo")) == 0 + + class uServerPlaybackState(libpry.AutoTree): def test_hash(self): s = flow.ServerPlaybackState(None) @@ -345,6 +356,7 @@ class uFlowMaster(libpry.AutoTree): tests = [ + uStickyCookieState(), uServerPlaybackState(), uFlow(), uState(), |