github.com/adnan-c/fabric_e2e_couchdb@v0.6.1-preview.0.20170228180935-21ce6b23cf91/common/configtx/test/helper_test.go (about)

     1  /*
     2  Copyright IBM Corp. 2017 All Rights Reserved.
     3  
     4  Licensed under the Apache License, Version 2.0 (the "License");
     5  you may not use this file except in compliance with the License.
     6  You may obtain a copy of the License at
     7  
     8                   http://www.apache.org/licenses/LICENSE-2.0
     9  
    10  Unless required by applicable law or agreed to in writing, software
    11  distributed under the License is distributed on an "AS IS" BASIS,
    12  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    13  See the License for the specific language governing permissions and
    14  limitations under the License.
    15  */
    16  
    17  package test
    18  
    19  import (
    20  	"os"
    21  	"path/filepath"
    22  	"testing"
    23  
    24  	logging "github.com/op/go-logging"
    25  )
    26  
    27  func init() {
    28  	// Configuration is always specified relative to $GOPATH/github.com/hyperledger/fabric
    29  	// This test will fail with the default configuration if executed in the package dir
    30  	// We are in common/configtx/test
    31  	os.Chdir(filepath.Join("..", "..", ".."))
    32  
    33  	logging.SetLevel(logging.DEBUG, "")
    34  }
    35  
    36  func TestMakeGenesisBlock(t *testing.T) {
    37  	_, err := MakeGenesisBlock("foo")
    38  	if err != nil {
    39  		t.Fatalf("Error making genesis block: %s", err)
    40  	}
    41  }
    42  
    43  func TestOrdererTemplate(t *testing.T) {
    44  	_ = OrdererTemplate()
    45  }
    46  
    47  func TestOrdererOrgTemplate(t *testing.T) {
    48  	_ = OrdererOrgTemplate()
    49  }
    50  
    51  func TestApplicationOrgTemplate(t *testing.T) {
    52  	_ = ApplicationOrgTemplate()
    53  }
    54  
    55  func TestCompositeTemplate(t *testing.T) {
    56  	_ = CompositeTemplate()
    57  }