github.com/yacovm/fabric@v2.0.0-alpha.0.20191128145320-c5d4087dc723+incompatible/common/policies/util_test.go (about) 1 /* 2 Copyright IBM Corp. All Rights Reserved. 3 4 SPDX-License-Identifier: Apache-2.0 5 */ 6 7 package policies 8 9 import ( 10 "testing" 11 12 cb "github.com/hyperledger/fabric-protos-go/common" 13 "github.com/stretchr/testify/assert" 14 ) 15 16 func basicTest(t *testing.T, sv *StandardConfigPolicy) { 17 assert.NotNil(t, sv) 18 assert.NotEmpty(t, sv.Key()) 19 assert.NotNil(t, sv.Value()) 20 } 21 22 func TestUtilsBasic(t *testing.T) { 23 basicTest(t, ImplicitMetaAnyPolicy("foo")) 24 basicTest(t, ImplicitMetaAllPolicy("foo")) 25 basicTest(t, ImplicitMetaMajorityPolicy("foo")) 26 basicTest(t, SignaturePolicy("foo", &cb.SignaturePolicyEnvelope{})) 27 }