MCPcopy Create free account
hub / github.com/Thunder-Compute/thunder-cli / TestCreateConfigTemplateCaseInsensitive

Function TestCreateConfigTemplateCaseInsensitive

cmd/create_test.go:410–426  ·  view source on GitHub ↗

TestCreateConfigTemplateCaseInsensitive verifies that template matching is case-insensitive when comparing with display names.

(t *testing.T)

Source from the content-addressed store, hash-verified

408// TestCreateConfigTemplateCaseInsensitive verifies that template matching
409// is case-insensitive when comparing with display names.
410func TestCreateConfigTemplateCaseInsensitive(t *testing.T) {
411 config := &tui.CreateConfig{
412 GPUType: "a6000",
413 VCPUs: 6,
414 Template: "UBUNTU 22.04",
415 DiskSizeGB: 100,
416 }
417
418 templates := []api.TemplateEntry{
419 tmplEntry("ubuntu-22.04", "Ubuntu 22.04"),
420 }
421
422 err := validateCreateConfig(config, templates, []api.Snapshot{}, false, testSpecStore())
423 require.NoError(t, err)
424
425 assert.Equal(t, "ubuntu-22.04", config.Template)
426}
427
428// TestCreateConfigTemplateByDisplayName verifies that templates can be
429// matched by their display name and converted to the appropriate key.

Callers

nothing calls this directly

Calls 3

tmplEntryFunction · 0.85
validateCreateConfigFunction · 0.85
testSpecStoreFunction · 0.70

Tested by

no test coverage detected