Skip to content

Commit

Permalink
add test
Browse files Browse the repository at this point in the history
  • Loading branch information
marekbrysa committed May 31, 2022
1 parent 7c53c42 commit 638b9f5
Showing 1 changed file with 19 additions and 0 deletions.
19 changes: 19 additions & 0 deletions storage/gs_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -94,3 +94,22 @@ func TestCreateOrValidateClusterForGoogleStorage_WorksOnDeletedCluster(t *testin
assert.Equal(t, "new-cluster", d.Get("cluster_id"))
})
}

func TestCreateOrValidateClusterForGoogleStorage_FailsOnErrorGettingCluster(t *testing.T) {
qa.HTTPFixturesApply(t, []qa.HTTPFixture{
{
Method: "GET",
Resource: "/api/2.0/clusters/get?cluster_id=my-cluster",
Status: 500,
Response: common.APIError{
ErrorCode: "SERVER_ERROR",
StatusCode: 500,
Message: "Server error",
},
},
}, func(ctx context.Context, client *common.DatabricksClient) {
d := ResourceMount().TestResourceData()
err := createOrValidateClusterForGoogleStorage(ctx, client, d, "my-cluster", "service-account")
assert.EqualError(t, err, "cannot get mounting cluster: Server error")
})
}

0 comments on commit 638b9f5

Please sign in to comment.