github.com/true-sqn/fabric@v2.1.1+incompatible/bccsp/factory/nopkcs11_test.go (about) 1 // +build !pkcs11 2 3 /* 4 Copyright IBM Corp. All Rights Reserved. 5 6 SPDX-License-Identifier: Apache-2.0 7 */ 8 9 package factory 10 11 import ( 12 "testing" 13 14 "github.com/stretchr/testify/assert" 15 ) 16 17 func TestInitFactories(t *testing.T) { 18 err := initFactories(&FactoryOpts{ 19 ProviderName: "SW", 20 SwOpts: &SwOpts{}, 21 }) 22 assert.EqualError(t, err, "Failed initializing BCCSP: Could not initialize BCCSP SW [Failed initializing configuration at [0,]: Hash Family not supported []]") 23 24 err = initFactories(&FactoryOpts{ 25 ProviderName: "PKCS11", 26 }) 27 assert.EqualError(t, err, "Could not find default `PKCS11` BCCSP") 28 }