channel_mock
Channel mock for simulating paramiko channel behavior with exit status support.
ChannelMock
Mock class that simulates paramiko channel behavior. This provides the recv_exit_status() method that real paramiko channels have.
Source code in src/paramiko_mock/channel_mock.py
6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 | |
closed
property
Check if the channel is closed.
__init__(exit_status=0)
Initialize the channel mock with an exit status.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
exit_status
|
int
|
The exit status code to return (default: 0) |
0
|
Source code in src/paramiko_mock/channel_mock.py
12 13 14 15 16 17 18 19 20 | |
close()
Close the channel.
Source code in src/paramiko_mock/channel_mock.py
40 41 42 | |
recv_exit_status()
Simulate the recv_exit_status method of paramiko channels.
Returns:
| Type | Description |
|---|---|
int
|
The exit status code |
Source code in src/paramiko_mock/channel_mock.py
22 23 24 25 26 27 28 29 | |
set_exit_status(exit_status)
Set the exit status for this channel.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
exit_status
|
int
|
The exit status code to set |
required |
Source code in src/paramiko_mock/channel_mock.py
31 32 33 34 35 36 37 38 | |