TestCreateConfigTemplateByDisplayName verifies that templates can be matched by their display name and converted to the appropriate key.
(t *testing.T)
| 428 | // TestCreateConfigTemplateByDisplayName verifies that templates can be |
| 429 | // matched by their display name and converted to the appropriate key. |
| 430 | func 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. |
nothing calls this directly
no test coverage detected