aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMaximilian Hils <git@maximilianhils.com>2020-02-04 21:39:15 +0100
committerGitHub <noreply@github.com>2020-02-04 21:39:15 +0100
commit735b8e35c9d142e43f002dfe224f431399548e3b (patch)
tree6a341e1745a4488722984d42d517c45090bec6b9
parentfdc0864b2df5db9c1afdb425e98aec066996c194 (diff)
parentbe4ba3f1c6588fa519e08460121f5dac5837843e (diff)
downloadmitmproxy-735b8e35c9d142e43f002dfe224f431399548e3b.tar.gz
mitmproxy-735b8e35c9d142e43f002dfe224f431399548e3b.tar.bz2
mitmproxy-735b8e35c9d142e43f002dfe224f431399548e3b.zip
Merge pull request #3809 from mhils/issue-3801
fix #3801
-rw-r--r--test/mitmproxy/test_command.py9
1 files changed, 8 insertions, 1 deletions
diff --git a/test/mitmproxy/test_command.py b/test/mitmproxy/test_command.py
index a432f9e3..7158935a 100644
--- a/test/mitmproxy/test_command.py
+++ b/test/mitmproxy/test_command.py
@@ -512,9 +512,15 @@ class TAttr:
raise IOError
+class TAttr2:
+ def __getattr__(self, item):
+ return TAttr2()
+
+
class TCmds(TAttr):
def __init__(self):
self.TAttr = TAttr()
+ self.TAttr2 = TAttr2()
@command.command("empty")
def empty(self) -> None:
@@ -524,7 +530,8 @@ class TCmds(TAttr):
@pytest.mark.asyncio
async def test_collect_commands():
"""
- This tests for the error thrown by hasattr()
+ This tests for errors thrown by getattr() or __getattr__ implementations
+ that return an object for .command_name.
"""
with taddons.context() as tctx:
c = command.CommandManager(tctx.master)