mirror of
https://github.com/coder/coder.git
synced 2025-07-12 00:14:10 +00:00
* chore: Fix golangci-lint configuration and patch errors Due to misconfiguration of a linting rules directory, our linter has not been working properly. This change fixes the configuration issue, and all remaining linting errors. * Fix race in peer logging * Fix race and return * Lock on bufferred amount low * Fix mutex lock
35 lines
823 B
Go
35 lines
823 B
Go
package codersdk_test
|
|
|
|
import (
|
|
"context"
|
|
"net/http"
|
|
"testing"
|
|
|
|
"github.com/stretchr/testify/require"
|
|
|
|
"github.com/coder/coder/coderd"
|
|
"github.com/coder/coder/coderd/coderdtest"
|
|
"github.com/coder/coder/codersdk"
|
|
)
|
|
|
|
func TestUsers(t *testing.T) {
|
|
t.Run("MultipleInitial", func(t *testing.T) {
|
|
server := coderdtest.New(t)
|
|
_, err := server.Client.CreateInitialUser(context.Background(), coderd.CreateUserRequest{
|
|
Email: "wowie@coder.com",
|
|
Username: "tester",
|
|
Password: "moo",
|
|
})
|
|
var cerr *codersdk.Error
|
|
require.ErrorAs(t, err, &cerr)
|
|
require.Equal(t, cerr.StatusCode(), http.StatusConflict)
|
|
require.Greater(t, len(cerr.Error()), 0)
|
|
})
|
|
|
|
t.Run("Get", func(t *testing.T) {
|
|
server := coderdtest.New(t)
|
|
_, err := server.Client.User(context.Background(), "")
|
|
require.NoError(t, err)
|
|
})
|
|
}
|