pub struct MockSshClient { /* private fields */ }Expand description
Mock SSH client for testing.
Implementations§
Source§impl MockSshClient
impl MockSshClient
Sourcepub fn new(config: WorkerConfig, mock_config: MockConfig) -> Self
pub fn new(config: WorkerConfig, mock_config: MockConfig) -> Self
Create a new mock SSH client.
Sourcepub fn new_default(config: WorkerConfig) -> Self
pub fn new_default(config: WorkerConfig) -> Self
Create with default mock config.
Sourcepub fn is_connected(&self) -> bool
pub fn is_connected(&self) -> bool
Check if “connected”.
Sourcepub fn invocations(&self) -> Vec<MockInvocation>
pub fn invocations(&self) -> Vec<MockInvocation>
Get recorded invocations.
Sourcepub fn clear_invocations(&self)
pub fn clear_invocations(&self)
Clear recorded invocations.
Sourcepub async fn disconnect(&mut self) -> Result<()>
pub async fn disconnect(&mut self) -> Result<()>
Simulate disconnecting from the worker.
Sourcepub async fn execute(&self, command: &str) -> Result<CommandResult>
pub async fn execute(&self, command: &str) -> Result<CommandResult>
Simulate executing a command.
Sourcepub async fn execute_streaming<F, G>(
&self,
command: &str,
on_stdout: F,
on_stderr: G,
) -> Result<CommandResult>
pub async fn execute_streaming<F, G>( &self, command: &str, on_stdout: F, on_stderr: G, ) -> Result<CommandResult>
Simulate streaming execution.
Sourcepub async fn health_check(&self) -> Result<bool>
pub async fn health_check(&self) -> Result<bool>
Simulate health check.
Auto Trait Implementations§
impl !Freeze for MockSshClient
impl RefUnwindSafe for MockSshClient
impl Send for MockSshClient
impl Sync for MockSshClient
impl Unpin for MockSshClient
impl UnsafeUnpin for MockSshClient
impl UnwindSafe for MockSshClient
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more