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

add new ioctl alias remove command and test #1843

Merged
merged 5 commits into from
Jan 29, 2020
Merged

add new ioctl alias remove command and test #1843

merged 5 commits into from
Jan 29, 2020

Conversation

zeromake
Copy link
Contributor

@zeromake zeromake requested a review from a team as a code owner January 23, 2020 08:53
@claassistantio
Copy link

claassistantio commented Jan 23, 2020

CLA assistant check
All committers have signed the CLA.

@codecov
Copy link

codecov bot commented Jan 23, 2020

Codecov Report

Merging #1843 into master will not change coverage.
The diff coverage is n/a.

Impacted file tree graph

@@           Coverage Diff           @@
##           master    #1843   +/-   ##
=======================================
  Coverage   56.51%   56.51%           
=======================================
  Files         167      167           
  Lines       13852    13852           
=======================================
  Hits         7828     7828           
  Misses       5020     5020           
  Partials     1004     1004

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update ff47462...c896a8c. Read the comment docs.

ioctl/newcmd/alias/aliasremove.go Outdated Show resolved Hide resolved
}
client.EXPECT().Config().Return(cfg).AnyTimes()
cmd := NewAliasRemove(client)
res, err := util.ExecuteCmd(cmd, "a")
Copy link
Collaborator

Choose a reason for hiding this comment

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

incomplete unit test: how do you verify that the corresponding alias has been removed?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@CoderZhi
supplementary test

ioctl/newcmd/alias/aliasremove_test.go Outdated Show resolved Hide resolved
ioctl/newcmd/alias/aliasremove_test.go Outdated Show resolved Hide resolved
Comment on lines +66 to +68
if err := ioutil.WriteFile(config.DefaultConfigFile, out, 0600); err != nil {
return output.NewError(output.WriteFileError, fmt.Sprintf(writeError, config.DefaultConfigFile), err)
}
Copy link
Collaborator

Choose a reason for hiding this comment

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

it would better if we can move these lines into client

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@CoderZhi
Does it mean adding a new method on the client?
E.g:

type Client interface {
     SaveConfig(cfg config.Config) error
}

@CoderZhi CoderZhi merged commit 6e270b3 into iotexproject:master Jan 29, 2020
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.

3 participants