Skip to content

Commit

Permalink
cmd: inspect unittest (MORE TESTS)
Browse files Browse the repository at this point in the history
  • Loading branch information
randomshinichi committed Feb 19, 2019
1 parent 721eca4 commit f10e442
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 2 deletions.
4 changes: 2 additions & 2 deletions cmd/inspect.go
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ var inspectCmd = &cobra.Command{
Long: `Inspect an object of the chain
Valid object to inspect are block hash, transaction hash, accounts`,
Run: inspect,
Run: inspectFunc,
Args: cobra.MinimumNArgs(1),
}

Expand All @@ -60,7 +60,7 @@ func printResult(title string, v interface{}, err error) {
aeternity.PrintObject(title, v)
}

func inspect(cmd *cobra.Command, args []string) {
func inspectFunc(cmd *cobra.Command, args []string) {
aeCli := NewAeCli()
for _, object := range args {
// height
Expand Down
13 changes: 13 additions & 0 deletions cmd/inspect_test.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
package cmd

import (
"testing"

"github.com/spf13/cobra"
)

func TestInspect(t *testing.T) {
setCLIConfig()
emptyCmd := cobra.Command{}
inspectFunc(&emptyCmd, []string{"ak_2a1j2Mk9YSmC1gioUq4PWRm3bsv887MbuRVwyv4KaUGoR1eiKi"})
}

0 comments on commit f10e442

Please sign in to comment.