-
Notifications
You must be signed in to change notification settings - Fork 14
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
CLI - config & version commands + tests
Signed-off-by: May Rosenbaum <[email protected]>
- Loading branch information
1 parent
65153d1
commit ec24b80
Showing
29 changed files
with
411 additions
and
142 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,27 @@ | ||
package commands | ||
|
||
import ( | ||
"github.com/hyperledger-labs/orion-sdk-go/examples/util" | ||
"github.com/stretchr/testify/require" | ||
"io/ioutil" | ||
"os" | ||
"testing" | ||
) | ||
|
||
func TestAdminCommand(t *testing.T) { | ||
// 1. Create crypto material and start server | ||
tempDir, err := ioutil.TempDir(os.TempDir(), "ExampleTest") | ||
require.NoError(t, err) | ||
|
||
testServer, _, _, err := util.SetupTestEnv(t, tempDir, uint32(6003)) | ||
require.NoError(t, err) | ||
defer testServer.Stop() | ||
util.StartTestServer(t, testServer) | ||
|
||
// 2. Check cas command response | ||
rootCmd := InitializeOrionCli() | ||
rootCmd.SetArgs([]string{"admin"}) | ||
err = rootCmd.Execute() | ||
require.Error(t, err) | ||
require.Equal(t, err.Error(), "not implemented yet") | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,27 @@ | ||
package commands | ||
|
||
import ( | ||
"github.com/hyperledger-labs/orion-sdk-go/examples/util" | ||
"github.com/stretchr/testify/require" | ||
"io/ioutil" | ||
"os" | ||
"testing" | ||
) | ||
|
||
func TestCasCommand(t *testing.T) { | ||
// 1. Create crypto material and start server | ||
tempDir, err := ioutil.TempDir(os.TempDir(), "ExampleTest") | ||
require.NoError(t, err) | ||
|
||
testServer, _, _, err := util.SetupTestEnv(t, tempDir, uint32(6003)) | ||
require.NoError(t, err) | ||
defer testServer.Stop() | ||
util.StartTestServer(t, testServer) | ||
|
||
// 2. Check cas command response | ||
rootCmd := InitializeOrionCli() | ||
rootCmd.SetArgs([]string{"CAs"}) | ||
err = rootCmd.Execute() | ||
require.Error(t, err) | ||
require.Equal(t, err.Error(), "not implemented yet") | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.