mirror of https://github.com/databricks/cli.git
Fix tests under ./cmd/configure if DATABRICKS_TOKEN is set (#605)
## Changes The assertions would fail because `DATABRICKS_TOKEN` overrides a token set in the profile. ## Tests Tests now pass if `DATABRICKS_TOKEN` is set.
This commit is contained in:
parent
5e0a096722
commit
f0ad28ab62
|
@ -14,8 +14,9 @@ import (
|
|||
|
||||
func assertKeyValueInSection(t *testing.T, section *ini.Section, keyName, expectedValue string) {
|
||||
key, err := section.GetKey(keyName)
|
||||
assert.NoError(t, err)
|
||||
assert.Equal(t, key.Value(), expectedValue)
|
||||
if assert.NoError(t, err) {
|
||||
assert.Equal(t, expectedValue, key.Value())
|
||||
}
|
||||
}
|
||||
|
||||
func setup(t *testing.T) string {
|
||||
|
@ -26,6 +27,7 @@ func setup(t *testing.T) string {
|
|||
}
|
||||
t.Setenv(homeEnvVar, tempHomeDir)
|
||||
t.Setenv("DATABRICKS_CONFIG_FILE", "")
|
||||
t.Setenv("DATABRICKS_TOKEN", "")
|
||||
return tempHomeDir
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue