mirror of
https://github.com/gitpod-io/gitpod.git
synced 2025-12-08 17:36:30 +00:00
* [db] Add go model for User * update helper constructor * fix * Add identity definition, and reference in User * fix * fix
24 lines
655 B
Go
24 lines
655 B
Go
// Copyright (c) 2023 Gitpod GmbH. All rights reserved.
|
|
// Licensed under the GNU Affero General Public License (AGPL).
|
|
// See License.AGPL.txt in the project root for license information.
|
|
|
|
package db_test
|
|
|
|
import (
|
|
"context"
|
|
"testing"
|
|
|
|
db "github.com/gitpod-io/gitpod/components/gitpod-db/go"
|
|
"github.com/gitpod-io/gitpod/components/gitpod-db/go/dbtest"
|
|
"github.com/stretchr/testify/require"
|
|
)
|
|
|
|
func TestGetUser(t *testing.T) {
|
|
conn := dbtest.ConnectForTests(t).Debug()
|
|
user := dbtest.CreatUsers(t, conn, db.User{})[0]
|
|
|
|
retrived, err := db.GetUser(context.Background(), conn, user.ID)
|
|
require.NoError(t, err)
|
|
require.Equal(t, user, retrived)
|
|
}
|