(t *testing.T)
| 578 | } |
| 579 | |
| 580 | func 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 | |
| 608 | func Test_FilterDesire(t *testing.T) { |
| 609 | // case 0 |
nothing calls this directly
no test coverage detected