mirror of https://github.com/databricks/cli.git
Enable linter bodyclose (#1968)
## Changes Enable linter '[bodyclose](https://github.com/timakin/bodyclose)' and fix 2 cases in tests. ## Tests Existing tests.
This commit is contained in:
parent
62bc59a3a6
commit
4c1042132b
|
@ -1,6 +1,7 @@
|
|||
linters:
|
||||
disable-all: true
|
||||
enable:
|
||||
- bodyclose
|
||||
# errcheck and govet are part of default setup and should be included but give too many errors now
|
||||
# once errors are fixed, they should be enabled here:
|
||||
#- errcheck
|
||||
|
|
|
@ -15,6 +15,7 @@ import (
|
|||
"github.com/databricks/databricks-sdk-go/httpclient/fixtures"
|
||||
"github.com/databricks/databricks-sdk-go/qa"
|
||||
"github.com/stretchr/testify/assert"
|
||||
"github.com/stretchr/testify/require"
|
||||
"golang.org/x/oauth2"
|
||||
)
|
||||
|
||||
|
@ -182,7 +183,8 @@ func TestChallenge(t *testing.T) {
|
|||
|
||||
state := <-browserOpened
|
||||
resp, err := http.Get(fmt.Sprintf("http://%s?code=__THIS__&state=%s", appRedirectAddr, state))
|
||||
assert.NoError(t, err)
|
||||
require.NoError(t, err)
|
||||
defer resp.Body.Close()
|
||||
assert.Equal(t, 200, resp.StatusCode)
|
||||
|
||||
err = <-errc
|
||||
|
@ -221,7 +223,8 @@ func TestChallengeFailed(t *testing.T) {
|
|||
resp, err := http.Get(fmt.Sprintf(
|
||||
"http://%s?error=access_denied&error_description=Policy%%20evaluation%%20failed%%20for%%20this%%20request",
|
||||
appRedirectAddr))
|
||||
assert.NoError(t, err)
|
||||
require.NoError(t, err)
|
||||
defer resp.Body.Close()
|
||||
assert.Equal(t, 400, resp.StatusCode)
|
||||
|
||||
err = <-errc
|
||||
|
|
Loading…
Reference in New Issue