Skip to content

Commit

Permalink
FAB-14035 Add tests for configtxgen encoder
Browse files Browse the repository at this point in the history
The tests currently covering the configtxgen encoder are almost entirely
based on sample config and really cover almost none of the non-green
paths.  This CR simply replaces all of the existing test with a new
ginkgo suite covering 98.4% of lines.  The uncovered lines are
unreachable and will be removed in a later CR.

Change-Id: I2d2bfd7f4437511258a7832a7df0735fab2a2fbf
Signed-off-by: Jason Yellick <jyellick@us.ibm.com>
  • Loading branch information
Jason Yellick committed Feb 5, 2019
1 parent f8f0da1 commit 59ddcf5
Show file tree
Hide file tree
Showing 4 changed files with 1,023 additions and 243 deletions.
26 changes: 26 additions & 0 deletions common/tools/configtxgen/encoder/encoder_suite_test.go
@@ -0,0 +1,26 @@
/*
Copyright IBM Corp. All Rights Reserved.
SPDX-License-Identifier: Apache-2.0
*/

package encoder_test

import (
"testing"

. "github.com/onsi/ginkgo"
. "github.com/onsi/gomega"

"github.com/hyperledger/fabric/common/crypto"
)

//go:generate counterfeiter -o mock/local_signer.go --fake-name LocalSigner . localSigner
type localSigner interface {
crypto.LocalSigner
}

func TestEncoder(t *testing.T) {
RegisterFailHandler(Fail)
RunSpecs(t, "Encoder Suite")
}

0 comments on commit 59ddcf5

Please sign in to comment.