Beispiel #1
0
func TestDBConnectionToServer(t *testing.T) {
	db, _ := NewDB()
	defer db.Close()
	if err := obinary.ConnectToServer(db, dbUser, dbPass); err != nil {
		t.Fatal("Connection to database failed")
	}
}
Beispiel #2
0
// Runs before all tests
func TestMain(m *testing.M) {
	db, _ := NewDB()
	defer db.Close()

	// Test DB connection
	if err := obinary.ConnectToServer(db, dbUser, dbPass); err != nil {
		panic(err)
	}
	// Clean up tests database
	TearDown(db)

	// Set up test graph & document databases
	SetUp(db)

	Seed()

	// Run Tests
	ret := m.Run()

	// Clean up tests database
	TearDown(db)
	os.Exit(ret)
}