Skip to content
Snippets Groups Projects
Select Git revision
  • 91b39e06d19cc1b982ada8e26e5d8ab98e6e3428
  • release default
  • master protected
  • XX-4441
  • Jakub/rootless-CI
  • Anne/CI-Test
  • waitingRoundsRewrite
  • quantumSecure
  • fullRateLimit
  • XX-3564/TlsCipherSuite
  • hotfix/groupNotification
  • Josh/RateLimiting
  • debug/sourceOfErrors
  • XX-3540/TestCert
  • f76/error
  • notls
  • url-repo-rename
  • feature/dynamicAuthRemoval
  • jono/yaml
  • version-2_5_3
  • hotfix/signing
  • v3.13.0
  • v3.11.0
  • v3.10.0
  • v3.9.0
  • v3.7.0
  • v3.6.0
  • v3.5.0
  • v3.1.0
  • v2.2.8
  • v2.2.7
  • v2.1.0
  • v2.0.0
  • v1.7.0
  • v1.6.0
  • v1.5.0
  • v1.4.2
  • v1.4.1
  • v1.4.0
  • v1.3.2
  • v1.3.1
41 results

db_test.go

Blame
  • db_test.go 1.07 KiB
    ////////////////////////////////////////////////////////////////////////////////
    // Copyright © 2019 Privategrity Corporation                                   /
    //                                                                             /
    // All rights reserved.                                                        /
    ////////////////////////////////////////////////////////////////////////////////
    
    package conf
    
    import (
    	"gitlab.com/elixxir/primitives/utils"
    	"gopkg.in/yaml.v2"
    	"reflect"
    	"testing"
    )
    
    var ExpectedDatabase = Database{
    	Name:     "name",
    	Username: "username",
    	Password: "password",
    	Address:  "127.0.0.1:80",
    }
    
    // This test checks that unmarshalling the params.yaml file
    // has the expected Database object.
    func TestDB_UnmarshallingFileEqualsExpected(t *testing.T) {
    
    	buf, _ := utils.ReadFile("./params.yaml")
    
    	actual := Params{}
    
    	err := yaml.Unmarshal(buf, &actual)
    	if err != nil {
    		t.Errorf("Unable to decode into struct, %v", err)
    	}
    
    	if !reflect.DeepEqual(ExpectedDatabase, actual.Database) {
    		t.Errorf("Database object did not match value")
    	}
    
    }