Example #1
0
//NewAdminMockup creates mockup of admin for testing purposes
func NewAdminMockup(user, password, dbName string) (*Admin, error) {
	db, err := extensions.ConnectMysql(user, password, dbName)
	if err != nil {
		return nil, err
	}
	admin := NewAdmin("test", "test")
	admin.db = db
	return admin, nil
}
Example #2
0
func init() {
	var err error
	cache, err = newStructCache(TestNode{})
	if err != nil {
		panic(err)
	}

	db, err = extensions.ConnectMysql("prago", "prago", "prago_test")
	if err != nil {
		panic(err)
	}
}