github.com/fibonacci-chain/fbc@v0.0.0-20231124064014-c7636198c1e9/libs/cosmos-sdk/store/cachemulti/store_test.go (about) 1 package cachemulti 2 3 import ( 4 "fmt" 5 "testing" 6 7 "github.com/fibonacci-chain/fbc/libs/cosmos-sdk/store/types" 8 "github.com/stretchr/testify/require" 9 ) 10 11 func TestStoreGetKVStore(t *testing.T) { 12 require := require.New(t) 13 14 s := Store{stores: map[types.StoreKey]types.CacheWrap{}} 15 key := types.NewKVStoreKey("abc") 16 errMsg := fmt.Sprintf("kv store with key %v has not been registered in stores", key) 17 18 require.PanicsWithValue(errMsg, 19 func() { s.GetStore(key) }) 20 21 require.PanicsWithValue(errMsg, 22 func() { s.GetKVStore(key) }) 23 }