VerifyAppPackageContentsV2 verifies the contents of a V2 app package by downloading the package zip and verifying the zipped files match the passed files.
(appName string, files ...string)
| 59 | // VerifyAppPackageContentsV2 verifies the contents of a V2 app package by downloading the package zip and |
| 60 | // verifying the zipped files match the passed files. |
| 61 | func VerifyAppPackageContentsV2(appName string, files ...string) { |
| 62 | tmpZipFilepath, err := os.CreateTemp("", "") |
| 63 | defer os.Remove(tmpZipFilepath.Name()) |
| 64 | Expect(err).ToNot(HaveOccurred()) |
| 65 | |
| 66 | downloadFirstAppBits(appName, tmpZipFilepath.Name()) |
| 67 | Expect(err).ToNot(HaveOccurred()) |
| 68 | |
| 69 | info, err := tmpZipFilepath.Stat() |
| 70 | Expect(err).ToNot(HaveOccurred()) |
| 71 | reader, err := ykk.NewReader(tmpZipFilepath, info.Size()) |
| 72 | Expect(err).ToNot(HaveOccurred()) |
| 73 | |
| 74 | seenFiles := []string{} |
| 75 | for _, file := range reader.File { |
| 76 | seenFiles = append(seenFiles, file.Name) |
| 77 | } |
| 78 | |
| 79 | Expect(seenFiles).To(ConsistOf(files)) |
| 80 | } |
| 81 | |
| 82 | func downloadFirstAppBits(appName string, tmpZipFilepath string) { |
| 83 | appGUID := AppGUID(appName) |
no test coverage detected