diff options
author | Nicolas Esteves <hamstahguru@gmail.com> | 2013-04-06 19:18:12 +0100 |
---|---|---|
committer | Nicolas Esteves <hamstahguru@gmail.com> | 2013-04-06 19:21:13 +0100 |
commit | d4cfbbb822f786b7e1f0ab9282dd76ee04ccb178 (patch) | |
tree | 2f810bf703379223be5994ce6f0c3c06e9f5bd39 /test | |
parent | 51b775cfd4165ed80dcb5458ddff942125fcba31 (diff) | |
download | mitmproxy-d4cfbbb822f786b7e1f0ab9282dd76ee04ccb178.tar.gz mitmproxy-d4cfbbb822f786b7e1f0ab9282dd76ee04ccb178.tar.bz2 mitmproxy-d4cfbbb822f786b7e1f0ab9282dd76ee04ccb178.zip |
Adds a new view for protocol buffers
The view uses protoc from the Google protocol buffer
tools. If the tool isn't installed, the view isn't
shown.
Google protobuf repo:
https://code.google.com/p/protobuf/
Diffstat (limited to 'test')
-rw-r--r-- | test/data/protobuf01 | 2 | ||||
-rw-r--r-- | test/test_console_contentview.py | 8 |
2 files changed, 10 insertions, 0 deletions
diff --git a/test/data/protobuf01 b/test/data/protobuf01 new file mode 100644 index 00000000..fbfdbff3 --- /dev/null +++ b/test/data/protobuf01 @@ -0,0 +1,2 @@ + +$3bbc333c-e61c-433b-819a-0b9a8cc103b8
\ No newline at end of file diff --git a/test/test_console_contentview.py b/test/test_console_contentview.py index 77178842..1798ce85 100644 --- a/test/test_console_contentview.py +++ b/test/test_console_contentview.py @@ -234,6 +234,14 @@ if pyamf: p = tutils.test_data.path("data/amf03") assert v([], file(p).read(), sys.maxint) +if cv.ViewProtobuf.is_available(): + def test_view_protobuf_request(): + v = cv.ViewProtobuf() + + p = tutils.test_data.path("data/protobuf01") + content_type, output = v([], file(p).read(), sys.maxint) + assert content_type == "Protobuf" + assert output[0].text == '1: "3bbc333c-e61c-433b-819a-0b9a8cc103b8"' def test_get_by_shortcut(): assert cv.get_by_shortcut("h") |