MCPcopy Index your code
hub / github.com/coder/coder / TestUpdateWorkspaceAutomaticUpdates_NotFound

Function TestUpdateWorkspaceAutomaticUpdates_NotFound

coderd/workspaces_test.go:3804–3823  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

3802}
3803
3804func TestUpdateWorkspaceAutomaticUpdates_NotFound(t *testing.T) {
3805 t.Parallel()
3806 var (
3807 client = coderdtest.New(t, nil)
3808 _ = coderdtest.CreateFirstUser(t, client)
3809 wsid = uuid.New()
3810 req = codersdk.UpdateWorkspaceAutomaticUpdatesRequest{
3811 AutomaticUpdates: codersdk.AutomaticUpdatesNever,
3812 }
3813 )
3814
3815 ctx, cancel := context.WithTimeout(context.Background(), testutil.WaitLong)
3816 defer cancel()
3817
3818 err := client.UpdateWorkspaceAutomaticUpdates(ctx, wsid, req)
3819 require.IsType(t, err, &codersdk.Error{}, "expected codersdk.Error")
3820 coderSDKErr, _ := err.(*codersdk.Error) //nolint:errorlint
3821 require.Equal(t, coderSDKErr.StatusCode(), 404, "expected status code 404")
3822 require.Contains(t, coderSDKErr.Message, "Resource not found", "unexpected response code")
3823}
3824
3825func TestWorkspaceWatcher(t *testing.T) {
3826 t.Parallel()

Callers

nothing calls this directly

Calls 7

NewFunction · 0.92
CreateFirstUserFunction · 0.92
NewMethod · 0.65
EqualMethod · 0.45
StatusCodeMethod · 0.45
ContainsMethod · 0.45

Tested by

no test coverage detected