(t *testing.T)
| 331 | } |
| 332 | |
| 333 | func TestWithTemplateBase(t *testing.T) { |
| 334 | ctx := logging.TestContext(t.Context()) |
| 335 | wfClientset := fakewfclientset.NewSimpleClientset() |
| 336 | wftmpl := unmarshalWftmpl(baseWorkflowTemplateYaml) |
| 337 | log := logging.RequireLoggerFromContext(ctx) |
| 338 | tplCtx := NewContextFromClientSet(wfClientset.ArgoprojV1alpha1().WorkflowTemplates(metav1.NamespaceDefault), wfClientset.ArgoprojV1alpha1().ClusterWorkflowTemplates(), wftmpl, nil, log) |
| 339 | |
| 340 | anotherWftmpl := unmarshalWftmpl(anotherWorkflowTemplateYaml) |
| 341 | |
| 342 | // Get the template base of existing template name. |
| 343 | newCtx := tplCtx.WithTemplateBase(anotherWftmpl) |
| 344 | wftmpl, ok := newCtx.tmplBase.(*wfv1.WorkflowTemplate) |
| 345 | require.True(t, ok, "tmplBase is not a WorkflowTemplate") |
| 346 | assert.Equal(t, "another-workflow-template", wftmpl.Name) |
| 347 | } |
| 348 | |
| 349 | func TestOnWorkflowTemplate(t *testing.T) { |
| 350 | wfClientset := fakewfclientset.NewSimpleClientset() |
nothing calls this directly
no test coverage detected