MCPcopy Create free account
hub / github.com/quay/clair / TestDisableUpdaters

Function TestDisableUpdaters

config/config_test.go:385–427  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

383}
384
385func TestDisableUpdaters(t *testing.T) {
386 setsEmpty := func(t *testing.T, c *config.Config, err error) {
387 if err != nil {
388 t.Errorf("unexpected error: %v", err)
389 }
390 if !cmp.Equal(c.Updaters.Sets, []string{}) {
391 t.Error(cmp.Diff(c.Updaters.Sets, []string{}))
392 }
393 }
394 tt := []ValidateTestcase{
395 {
396 Name: "ComboMode",
397 Conf: config.Config{
398 Mode: config.ComboMode,
399 Matcher: config.Matcher{
400 DisableUpdaters: true,
401 },
402 Updaters: config.Updaters{
403 Sets: []string{"alpine", "aws"},
404 },
405 },
406 Check: setsEmpty,
407 },
408 {
409 Name: "MatcherMode",
410 Conf: config.Config{
411 Mode: config.MatcherMode,
412 Matcher: config.Matcher{
413 IndexerAddr: "http://example.com/",
414 DisableUpdaters: true,
415 },
416 Updaters: config.Updaters{
417 Sets: []string{"alpine", "aws"},
418 },
419 },
420 Check: setsEmpty,
421 },
422 }
423
424 for _, tc := range tt {
425 t.Run(tc.Name, tc.Run)
426 }
427}

Callers

nothing calls this directly

Calls 2

ErrorMethod · 0.45
RunMethod · 0.45

Tested by

no test coverage detected