CLI JSON updates (#962)

See Changelog for details.
This commit is contained in:
Jeff Mitchell authored and GitHub committed 2021-02-25 12:43:17 -05:00
1 parent b967ff7f05
commit 72aa110f72
50 files changed
+489 -540

No files matched your search

+4 -4
View File
@@ -126,7 +126,7 @@ func TestCrud(t *testing.T) {
require.Error(err)
apiErr := api.AsServerError(err)
assert.NotNil(apiErr)
assert.EqualValues(http.StatusNotFound, apiErr.ResponseStatus())
assert.EqualValues(http.StatusNotFound, apiErr.Response().StatusCode())
}
func TestErrors(t *testing.T) {
@@ -154,7 +154,7 @@ func TestErrors(t *testing.T) {
require.Error(err)
apiErr := api.AsServerError(err)
assert.NotNil(apiErr)
assert.EqualValues(http.StatusNotFound, apiErr.ResponseStatus())
assert.EqualValues(http.StatusNotFound, apiErr.Response().StatusCode())
_, err = hClient.Create(tc.Context(), hc.Item.Id, hosts.WithName("foo"), hosts.WithStaticHostAddress("someaddress"))
require.Error(err)
@@ -165,11 +165,11 @@ func TestErrors(t *testing.T) {
require.Error(err)
apiErr = api.AsServerError(err)
assert.NotNil(apiErr)
assert.EqualValues(http.StatusNotFound, apiErr.ResponseStatus())
assert.EqualValues(http.StatusNotFound, apiErr.Response().StatusCode())
_, err = hClient.Read(tc.Context(), "invalid id")
require.Error(err)
apiErr = api.AsServerError(err)
assert.NotNil(apiErr)
assert.EqualValues(http.StatusBadRequest, apiErr.ResponseStatus())
assert.EqualValues(http.StatusBadRequest, apiErr.Response().StatusCode())
}