Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
gitpod-io
GitHub Repository: gitpod-io/gitpod
Path: blob/main/components/gitpod-db/go/user_test.go
2497 views
1
// Copyright (c) 2023 Gitpod GmbH. All rights reserved.
2
// Licensed under the GNU Affero General Public License (AGPL).
3
// See License.AGPL.txt in the project root for license information.
4
5
package db_test
6
7
import (
8
"context"
9
"testing"
10
11
db "github.com/gitpod-io/gitpod/components/gitpod-db/go"
12
"github.com/gitpod-io/gitpod/components/gitpod-db/go/dbtest"
13
"github.com/stretchr/testify/require"
14
)
15
16
func TestGetUser(t *testing.T) {
17
conn := dbtest.ConnectForTests(t).Debug()
18
user := dbtest.CreatUsers(t, conn, db.User{})[0]
19
20
retrived, err := db.GetUser(context.Background(), conn, user.ID)
21
require.NoError(t, err)
22
require.Equal(t, user, retrived)
23
}
24
25