add test for the get method

This commit is contained in:
Shreyas Goenka 2025-01-06 18:03:11 +05:30
parent 8607e0808c
commit 39dfe05a73
No known key found for this signature in database
GPG Key ID: 92A07DF49CCB0622
1 changed files with 27 additions and 0 deletions

View File

@ -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)
}
}