mirror of
https://github.com/coder/coder.git
synced 2025-07-12 00:14:10 +00:00
* Nest jobs under an organization * Rename project parameter to parameter schema * Update references when computing project parameters * Add files endpoint * Allow one-off project import jobs * Allow variables to be injected that are not defined by the schema * Update API to use jobs first * Fix CLI tests * Fix linting * Fix hex length for files table * Reduce memory allocation for windows
29 lines
653 B
Go
29 lines
653 B
Go
package codersdk_test
|
|
|
|
import (
|
|
"context"
|
|
"testing"
|
|
|
|
"github.com/stretchr/testify/require"
|
|
|
|
"github.com/coder/coder/coderd/coderdtest"
|
|
"github.com/coder/coder/codersdk"
|
|
)
|
|
|
|
func TestUpload(t *testing.T) {
|
|
t.Parallel()
|
|
t.Run("Error", func(t *testing.T) {
|
|
t.Parallel()
|
|
client := coderdtest.New(t)
|
|
_, err := client.UploadFile(context.Background(), "wow", []byte{})
|
|
require.Error(t, err)
|
|
})
|
|
t.Run("Upload", func(t *testing.T) {
|
|
t.Parallel()
|
|
client := coderdtest.New(t)
|
|
_ = coderdtest.CreateInitialUser(t, client)
|
|
_, err := client.UploadFile(context.Background(), codersdk.ContentTypeTar, []byte{'a'})
|
|
require.NoError(t, err)
|
|
})
|
|
}
|