Skip to content

Commit

Permalink
[FAB-8453] Add tests to cc instantiate package
Browse files Browse the repository at this point in the history
Tests to ensure that the policy parser supports MSP IDs with '.' characters
have been added to the package that handles chaincode instantiation as well.

Change-Id: I0614ef04920d27716bdefd59cfe961ff8396cf46
Signed-off-by: Alessandro Sorniotti <ale.linux@sopit.net>
  • Loading branch information
ale-linux committed Feb 24, 2018
1 parent f66e8fd commit 21281c6
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions peer/chaincode/instantiate_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,12 @@ func TestInstantiateCmd(t *testing.T) {
errorExpected: true,
errMsg: "Expected error executing instantiate command without the -c option",
},
{
name: "successful with policy",
args: []string{"-P", "OR('MSP.member', 'MSP.WITH.DOTS.member', 'MSP-WITH-DASHES.member')", "-n", "example02", "-v", "anotherversion", "-C", "mychannel", "-c", "{\"Args\": [\"init\",\"a\",\"100\",\"b\",\"200\"]}"},
errorExpected: false,
errMsg: "Run chaincode instantiate cmd error",
},
}
for _, test := range tests {
t.Run(test.name, func(t *testing.T) {
Expand Down

0 comments on commit 21281c6

Please sign in to comment.