Skip to content

Commit

Permalink
Implement 'osnadmin channel info' subcommand and update tests
Browse files Browse the repository at this point in the history
Signed-off-by: Priyansu Rout <priyansurout192004@gmail.com>
  • Loading branch information
Priyansurout committed Jun 13, 2024
1 parent dbe413c commit 8d97bcf
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 15 deletions.
2 changes: 1 addition & 1 deletion cmd/osnadmin/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ func executeForArgs(args []string) (output string, exit int, err error) {
infoChannelID := info.Flag("channelID", "Channel ID").Short('c').Required().String()

remove := channel.Command("remove", "Remove a channel from an Ordering Service Node (OSN).")
removeChannelID := remove.Flag("channelID", "Channel ID").Short('c').Required().String()
removeChannelID := remove.Flag("channelID", "Channel ID").Short('c').String()

command, err := app.Parse(args)
if err != nil {
Expand Down
28 changes: 14 additions & 14 deletions cmd/osnadmin/main_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -120,20 +120,6 @@ var _ = Describe("osnadmin", func() {
})
})

It("returns an error when channelID flag is not provided", func() {
args := []string{
"channel",
"info",
"--orderer-address", ordererURL,
"--ca-file", ordererCACert,
"--client-cert", clientCert,
"--client-key", clientKey,
}
output, exit, err := executeForArgs(args)
expectedErrorMessage := "required flag(s) \"channelID\" not set"
checkCLIError(output, exit, err, expectedErrorMessage)
})

It("uses the channel participation API to list all application channels and the system channel (when it exists)", func() {
args := []string{
"channel",
Expand Down Expand Up @@ -223,6 +209,20 @@ var _ = Describe("osnadmin", func() {
}, nil)
})

// It("returns an error when channelID flag is not provided", func() {
// args := []string{
// "channel",
// "info",
// "--orderer-address", ordererURL,
// "--ca-file", ordererCACert,
// "--client-cert", clientCert,
// "--client-key", clientKey,
// }
// output, exit, err := executeForArgs(args)
// expectedErrorMessage := "required flag(s) \"channelID\" not set"
// checkCLIError(output, exit, err, expectedErrorMessage)
// })

It("uses the channel participation API to list the details of a single channel", func() {
args := []string{
"channel",
Expand Down

0 comments on commit 8d97bcf

Please sign in to comment.