MCPcopy
hub / github.com/baetyl/baetyl / TestEngineImpl_applyApps

Function TestEngineImpl_applyApps

engine/engine_test.go:580–606  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

578}
579
580func TestEngineImpl_applyApps(t *testing.T) {
581 mockCtl := gomock.NewController(t)
582 defer mockCtl.Finish()
583 mockSync := mock.NewMockSync(mockCtl)
584 eng := engineImpl{
585 cfg: config.Config{},
586 syn: mockSync,
587 log: log.With(log.Any("engine", "test")),
588 }
589
590 ns := "default"
591 infos := map[string]specv1.AppInfo{
592 "test": {
593 Name: "core",
594 Version: "1",
595 },
596 }
597 stats := map[string]specv1.AppStats{
598 "core": {},
599 }
600
601 mockSync.EXPECT().SyncResource(gomock.Any()).Return(os.ErrInvalid).Times(1)
602
603 eng.applyApps(ns, infos, stats)
604
605 assert.Equal(t, stats["core"].Cause, os.ErrInvalid.Error())
606}
607
608func Test_FilterDesire(t *testing.T) {
609 // case 0

Callers

nothing calls this directly

Calls 4

EXPECTMethod · 0.95
applyAppsMethod · 0.95
NewMockSyncFunction · 0.92
SyncResourceMethod · 0.65

Tested by

no test coverage detected