gitlab.com/ignitionrobotics/web/ign-go@v1.0.0-rc4/database_test.go (about)

     1  package ign
     2  
     3  import (
     4  	"github.com/stretchr/testify/assert"
     5  	"testing"
     6  )
     7  
     8  /////////////////////////////////////////////////
     9  // Test a bad connection to the database
    10  func TestBadDatabase(t *testing.T) {
    11  	var server Server
    12  	server.Db = nil
    13  	err := server.dbInit()
    14  	assert.Error(t, err, "Should have received an error from the database")
    15  	assert.Nil(t, server.Db, "Database should be nil")
    16  }
    17  
    18  /// \todo: Figure out how to test the database without including username
    19  /// and password information in the source code