Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refactor: share code between CLI tests #4598

Merged
merged 2 commits into from
Oct 26, 2020
Merged

Conversation

dirkmc
Copy link
Contributor

@dirkmc dirkmc commented Oct 26, 2020

Just takes care of some tech-debt, no changes to non-test code.

This PR removes some duplicate code from the payment channels CLI tests.

Copy link
Contributor

@magik6k magik6k left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Linter seems to complain

Copy link
Contributor

@magik6k magik6k left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

1 nit, looks good otherwise

func (c *mockCLIClient) runCmd(input []string) string {
cmd := c.cmdByNameSub(input[0], input[1])
out, err := c.runCmdRaw(cmd, input[2:])
func (c *MockCLIClient) RunCmd(input []string) string {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could be

Suggested change
func (c *MockCLIClient) RunCmd(input []string) string {
func (c *MockCLIClient) RunCmd(input ...string) string {

So we could avoid constructing those cmd = []string{..} arrays everywhere

@magik6k magik6k merged commit 5a6195f into master Oct 26, 2020
@magik6k magik6k deleted the refactor/paych-cli-test branch October 26, 2020 13:51
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.

None yet

2 participants