AssertKptfile verifies the contents of the KptFile matches the provided value.
(t *testing.T, cloned string, kpkg kptfile.KptFile)
| 239 | |
| 240 | // AssertKptfile verifies the contents of the KptFile matches the provided value. |
| 241 | func (g *TestGitRepo) AssertKptfile(t *testing.T, cloned string, kpkg kptfile.KptFile) bool { |
| 242 | // read the actual generated KptFile |
| 243 | b, err := ioutil.ReadFile(filepath.Join(cloned, kptfile.KptFileName)) |
| 244 | if !assert.NoError(t, err) { |
| 245 | return false |
| 246 | } |
| 247 | actual := kptfile.KptFile{} |
| 248 | d := yaml.NewDecoder(bytes.NewBuffer(b)) |
| 249 | d.KnownFields(true) |
| 250 | if !assert.NoError(t, d.Decode(&actual)) { |
| 251 | return false |
| 252 | } |
| 253 | return assert.Equal(t, kpkg, actual) |
| 254 | } |
| 255 | |
| 256 | // CheckoutBranch checks out the git branch in the repo |
| 257 | func (g *TestGitRepo) CheckoutBranch(branch string, create bool) error { |
no outgoing calls