DpExchange.Schwab.Fake (DpExchangeSchwab v0.1.2)

Copy Markdown View Source

An in-process stand-in for this venue, for consumers' tests.

It refuses what the real venue refuses

A fake that answers where the real one would refuse is worse than no fake: it lets a consumer's test suite go green against behaviour that cannot happen. So this one reproduces the refusals, not just the successes — a pair-shaped symbol, a missing credential, a year of one-minute candles, an instruction that does not match the asset type. Each is the same error the real package returns, from the same module.

It closes the market on request

market_status/1 answers :open by default and :closed when told to, because a consumer testing an equities venue needs to exercise the overnight path — the one where a feed delivering nothing is correct. Every other venue in the family is always open, so this is the only place that path can be tested at all.

Starts nothing. start_link/1 returns :ignore, so a consumer that swaps this in does not find a process it did not ask for.

Summary

Functions

The instant every value from this fake is stamped with.

Symbols this fake lists.

Open by default, closed on request.

Quote currencies.

Endpoints the venue does not serve.

Functions

as_of()

@spec as_of() :: DateTime.t()

The instant every value from this fake is stamped with.

listed()

@spec listed() :: [String.t()]

Symbols this fake lists.

market_status(opts \\ [])

Open by default, closed on request.

The only place in the family where a consumer can exercise the closed-market path.

quotes()

@spec quotes() :: [String.t()]

Quote currencies.

venue_does_not_serve()

@spec venue_does_not_serve() :: [{atom(), arity()}]

Endpoints the venue does not serve.