From d2b6178350b2bdafb4e0083fcda5ea55e1b1cf4f Mon Sep 17 00:00:00 2001 From: "David J. Allen" Date: Tue, 10 Dec 2024 15:22:37 -0700 Subject: [PATCH] tests: fixed issue with server not starting with correct config --- tests/generate_test.go | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) diff --git a/tests/generate_test.go b/tests/generate_test.go index 077ad72..f458ebc 100644 --- a/tests/generate_test.go +++ b/tests/generate_test.go @@ -23,6 +23,8 @@ var ( err error ) +const () + // A valid test generator that implements the `Generator` interface. type TestGenerator struct{} @@ -33,17 +35,21 @@ func (g *TestGenerator) GetDescription() string { } func (g *TestGenerator) Generate(config *config.Config, params generator.Params) (generator.FileMap, error) { // Jinja 2 template file - files := [][]byte{ - []byte(` + files := map[string]generator.Template{ + "test1": generator.Template{ + Contents: []byte(` Name: {{plugin_name}} Version: {{plugin_version}} Description: {{plugin_description}} This is the first test template file. - `), - []byte(` + `), + }, + "test2": generator.Template{ + Contents: []byte(` This is another testing Jinja 2 template file using {{plugin_name}}. - `), + `), + }, } // apply Jinja templates to file @@ -51,7 +57,7 @@ This is another testing Jinja 2 template file using {{plugin_name}}. "plugin_name": g.GetName(), "plugin_version": g.GetVersion(), "plugin_description": g.GetDescription(), - }, params.Templates) + }, files) if err != nil { return nil, fmt.Errorf("failed to apply templates: %v", err) }