mirror of
https://github.com/Grasscutters/mitmproxy.git
synced 2024-11-25 09:37:37 +00:00
parent
a6f673fb29
commit
550e1a4ab3
@ -1,4 +1,3 @@
|
|||||||
import asyncio
|
|
||||||
from dataclasses import dataclass
|
from dataclasses import dataclass
|
||||||
|
|
||||||
from mitmproxy import hooks
|
from mitmproxy import hooks
|
||||||
@ -61,7 +60,7 @@ class Log:
|
|||||||
self(txt, "error")
|
self(txt, "error")
|
||||||
|
|
||||||
def __call__(self, text, level="info"):
|
def __call__(self, text, level="info"):
|
||||||
asyncio.get_event_loop().call_soon(
|
self.master.event_loop.call_soon_threadsafe(
|
||||||
self.master.addons.trigger, AddLogHook(LogEntry(text, level)),
|
self.master.addons.trigger, AddLogHook(LogEntry(text, level)),
|
||||||
)
|
)
|
||||||
|
|
||||||
|
@ -40,7 +40,7 @@ class TestCommandHistory:
|
|||||||
|
|
||||||
def test_add_command(self):
|
def test_add_command(self):
|
||||||
ch = command_history.CommandHistory()
|
ch = command_history.CommandHistory()
|
||||||
|
with taddons.context(ch):
|
||||||
ch.add_command('cmd1')
|
ch.add_command('cmd1')
|
||||||
ch.add_command('cmd2')
|
ch.add_command('cmd2')
|
||||||
assert ch.history == ['cmd1', 'cmd2']
|
assert ch.history == ['cmd1', 'cmd2']
|
||||||
|
Loading…
Reference in New Issue
Block a user