mirror of https://github.com/databricks/cli.git
add test for the get method
This commit is contained in:
parent
8607e0808c
commit
39dfe05a73
|
@ -60,3 +60,30 @@ func TestTemplateTelemetryIsCapturedForAllDefaultTemplates(t *testing.T) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func TestTemplateGet(t *testing.T) {
|
||||||
|
names := []TemplateName{
|
||||||
|
DefaultPython,
|
||||||
|
DefaultSql,
|
||||||
|
DbtSql,
|
||||||
|
MlopsStacks,
|
||||||
|
DefaultPydabs,
|
||||||
|
Custom,
|
||||||
|
}
|
||||||
|
|
||||||
|
for _, name := range names {
|
||||||
|
tmpl := Get(name)
|
||||||
|
assert.Equal(t, tmpl.name, name)
|
||||||
|
}
|
||||||
|
|
||||||
|
notExist := []string{
|
||||||
|
"/some/path",
|
||||||
|
"doesnotexist",
|
||||||
|
"https://www.someurl.com",
|
||||||
|
}
|
||||||
|
|
||||||
|
for _, name := range notExist {
|
||||||
|
tmpl := Get(TemplateName(name))
|
||||||
|
assert.Nil(t, tmpl)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
Loading…
Reference in New Issue