Skip to main content

Fake

Struct Fake 

Source
pub struct Fake { /* private fields */ }
Expand description

A recording transport for test layer 1.

Deliberately not #[cfg(test)]: integration tests live in their own crate and could not see it otherwise, and layer 1 is where most of coop’s logic is actually verified.

Implementations§

Source§

impl Fake

Source

pub fn new() -> Self

A fake with a live master and no queued output (every run yields an empty success).

Source

pub fn no_master() -> Self

A fake whose master is down, for the exit-3 path.

Source

pub fn push(&self, out: Output) -> &Self

Queue one reply. Replies are consumed in order.

Source

pub fn scripts(&self) -> Vec<String>

Every script handed to run, in order. This is the assertion surface for wrapper construction.

Trait Implementations§

Source§

impl Debug for Fake

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Default for Fake

Source§

fn default() -> Fake

Returns the “default value” for a type. Read more
Source§

impl Transport for Fake

Source§

fn run_unlocked(&self, _host: &Host, script: &str) -> Result<Output>

Run a shell script on the host, WITHOUT taking the ticket lock. Read more
Source§

fn master_alive(&self, _host: &Host) -> bool

Is there a usable multiplexing socket? ssh -O check only — it takes no session channel, so this probe never competes with anything, and it is the one call deliberately exempt from the lock.
Source§

fn run(&self, host: &Host, script: &str) -> Result<Output>

Run a shell script on the host, holding the host’s ticket lock. Read more

Auto Trait Implementations§

§

impl !Freeze for Fake

§

impl RefUnwindSafe for Fake

§

impl Send for Fake

§

impl Sync for Fake

§

impl Unpin for Fake

§

impl UnsafeUnpin for Fake

§

impl UnwindSafe for Fake

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.