From fc0bdc143cd28e59e5aecaad9d37ea40badf64f1 Mon Sep 17 00:00:00 2001 From: Manuel Meitinger Date: Tue, 29 Mar 2022 16:16:45 +0200 Subject: [PATCH] [dns] view test --- test/mitmproxy/addons/test_view.py | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/test/mitmproxy/addons/test_view.py b/test/mitmproxy/addons/test_view.py index 0aac242c5..5c2afbaeb 100644 --- a/test/mitmproxy/addons/test_view.py +++ b/test/mitmproxy/addons/test_view.py @@ -138,6 +138,20 @@ def test_simple_tcp(): assert list(v) == [f] +def test_simple_dns(): + v = view.View() + f = tflow.tdnsflow(resp=True, err=True) + assert v.store_count() == 0 + v.dns_request(f) + assert list(v) == [f] + + # These all just call update + v.dns_request(f) + v.dns_response(f) + v.dns_error(f) + assert list(v) == [f] + + def test_filter(): v = view.View() v.requestheaders(tft(method="get"))