mirror of
https://github.com/hansjone/netx.git
synced 2026-10-09 04:20:45 +08:00
Fix WebCRT connect crash from invalid Netmiko session_log wrapper.
Use a BytesIO subclass for live connect echo so Netmiko accepts the log object again. Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
parent
6ed08e24de
commit
6aedd2c522
3 changed files with 43 additions and 48 deletions
|
|
@ -14,6 +14,16 @@ from netx_api.ne_session_connect import (
|
|||
|
||||
|
||||
class PromptDetectTests(unittest.TestCase):
|
||||
def test_progress_bytesio_is_netmiko_compatible(self) -> None:
|
||||
import io
|
||||
|
||||
from netx_api.ne_session_connect import _ProgressBytesIO
|
||||
|
||||
buf = _ProgressBytesIO(lambda _t: None)
|
||||
self.assertIsInstance(buf, io.BufferedIOBase)
|
||||
# Plain custom log objects are what broke every WebCRT connect (ValueError).
|
||||
self.assertFalse(isinstance(object(), io.BufferedIOBase))
|
||||
|
||||
def test_huawei_username_and_password(self) -> None:
|
||||
self.assertEqual(
|
||||
_prompt_needs_auth("Please input the username:"),
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue