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

Function TestCreateConfigTemplateByDisplayName

cmd/create_test.go:430–446  ·  view source on GitHub ↗

TestCreateConfigTemplateByDisplayName verifies that templates can be matched by their display name and converted to the appropriate key.

(t *testing.T)

Source from the content-addressed store, hash-verified

428// TestCreateConfigTemplateByDisplayName verifies that templates can be
429// matched by their display name and converted to the appropriate key.
430func TestCreateConfigTemplateByDisplayName(t *testing.T) {
431 config := &tui.CreateConfig{
432 GPUType: "a6000",
433 VCPUs: 6,
434 Template: "Ubuntu 22.04",
435 DiskSizeGB: 100,
436 }
437
438 templates := []api.TemplateEntry{
439 tmplEntry("ubuntu-22.04", "Ubuntu 22.04"),
440 }
441
442 err := validateCreateConfig(config, templates, []api.Snapshot{}, false, testSpecStore())
443 require.NoError(t, err)
444
445 assert.Equal(t, "ubuntu-22.04", config.Template)
446}
447
448// TestCreateConfigDiskSizeBoundaries verifies that disk size validation
449// correctly enforces the storage range from the GPU spec.

Callers

nothing calls this directly

Calls 3

tmplEntryFunction · 0.85
validateCreateConfigFunction · 0.85
testSpecStoreFunction · 0.70

Tested by

no test coverage detected