(t *testing.T)
| 24 | ) |
| 25 | |
| 26 | func TestFilterServices(t *testing.T) { |
| 27 | p := &types.Project{ |
| 28 | Services: types.Services{ |
| 29 | "foo": { |
| 30 | Name: "foo", |
| 31 | Links: []string{"bar"}, |
| 32 | }, |
| 33 | "bar": { |
| 34 | Name: "bar", |
| 35 | DependsOn: map[string]types.ServiceDependency{ |
| 36 | "zot": {}, |
| 37 | }, |
| 38 | }, |
| 39 | "zot": { |
| 40 | Name: "zot", |
| 41 | }, |
| 42 | "qix": { |
| 43 | Name: "qix", |
| 44 | }, |
| 45 | }, |
| 46 | } |
| 47 | p, err := p.WithSelectedServices([]string{"bar"}) |
| 48 | assert.NilError(t, err) |
| 49 | |
| 50 | assert.Equal(t, len(p.Services), 2) |
| 51 | _, err = p.GetService("bar") |
| 52 | assert.NilError(t, err) |
| 53 | _, err = p.GetService("zot") |
| 54 | assert.NilError(t, err) |
| 55 | } |
nothing calls this directly
no outgoing calls
no test coverage detected