Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
mounts now handle deleted cluster correctly
- Loading branch information
Dave Storey
committed
Jun 9, 2020
1 parent
6f6fc0b
commit babef36
Showing
7 changed files
with
149 additions
and
23 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
package databricks | ||
|
||
import ( | ||
"testing" | ||
|
||
"github.com/stretchr/testify/assert" | ||
) | ||
|
||
func TestIsClusterMissingTrueWhenClusterIdSpecifiedPresent(t *testing.T) { | ||
errorMessage := "{\"error_code\":\"INVALID_PARAMETER_VALUE\",\"message\":\"Cluster 123 does not exist\"}" | ||
|
||
result := isClusterMissing(errorMessage, "123") | ||
|
||
assert.True(t, result) | ||
} | ||
|
||
func TestIsClusterMissingFalseWhenClusterIdSpecifiedNotPresent(t *testing.T) { | ||
errorMessage := "{\"error_code\":\"INVALID_PARAMETER_VALUE\",\"message\":\"Cluster 123 does not exist\"}" | ||
|
||
result := isClusterMissing(errorMessage, "xyz") | ||
|
||
assert.False(t, result) | ||
} | ||
|
||
func TestIsClusterMissingFalseWhenErrorNotInCorrectFormat(t *testing.T) { | ||
errorMessage := "{\"error_code\":\"INVALID_PARAMETER_VALUE\",\"message\":\"Something random went bang xyz\"}" | ||
|
||
result := isClusterMissing(errorMessage, "xyz") | ||
|
||
assert.False(t, result) | ||
} |