Skip to content

Add FakeClient wrapper #1

Merged
hlts2 merged 1 commit intomainfrom
fix/add-option
Feb 27, 2025
Merged

Add FakeClient wrapper #1
hlts2 merged 1 commit intomainfrom
fix/add-option

Conversation

@hlts2
Copy link
Copy Markdown
Member

@hlts2 hlts2 commented Feb 27, 2025

This PR include FakeClient, a test client designed for more flexible behavior control when civogo.FakeClient alone is not sufficient.

Changes

Added FakeClient, which embeds civogo.FakeClient and allows overriding HardRebootInstance via a function.
Ensured FakeClient satisfies the civogo.Clienter interface at compile time.

Motivation

The standard civogo.FakeClient may not always provide the required level of flexibility in testing. FakeClient enables customized behavior by allowing function injection for HardRebootInstance, making it easier to control test scenarios. By injecting behavior from the outside, we can perform more flexible and controlled tests.

Signed-off-by: hlts2 <hiroto.funakoshi.hiroto@gmail.com>
@hlts2 hlts2 self-assigned this Feb 27, 2025
@hlts2 hlts2 requested a review from jokestax February 27, 2025 11:03
@hlts2 hlts2 merged commit c24cee2 into main Feb 27, 2025
@hlts2 hlts2 deleted the fix/add-option branch February 27, 2025 11:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants