Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var DescribeTest = func(g generator.Generator, files embed.FS) func() { return func() { It("should render correctly", func() { expectedCloudInit, err := files.ReadFile("cloud-init") Expect(err).NotTo(HaveOccurred()) cloudInit, _, err := g.Generate(&generator.OperatingSystemConfig{ Object: &extensionsv1alpha1.OperatingSystemConfig{}, Files: []*generator.File{ { Path: "/foo", Content: []byte("bar"), Permissions: &onlyOwnerPerm, }, { Path: "/foo2", Content: []byte("bar"), TransmitUnencoded: pointer.BoolPtr(true), }, }, Units: []*generator.Unit{ { Name: "docker.service", Content: []byte("unit"), DropIns: []*generator.DropIn{ { Name: "10-docker-opts.conf", Content: []byte("override"), }, }, }, }, Bootstrap: true, }) Expect(err).NotTo(HaveOccurred()) Expect(cloudInit).To(Equal(expectedCloudInit)) }) } }
DescribeTest returns a function which can be used in tests for the template generator implementation. It receives an instance of a template generator and embedded files with the test files to be used in the tests.
Functions ¶
This section is empty.
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.