-
Notifications
You must be signed in to change notification settings - Fork 0
/
test_helpers.go
executable file
·47 lines (38 loc) · 932 Bytes
/
test_helpers.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
/*
Copyright (c) 2019 VMware, Inc. All Rights Reserved.
SPDX-License-Identifier: Apache-2.0
*/
package describer
import (
"context"
"github.com/kubenext/lissio/pkg/view/component"
)
type StubDescriber struct {
path string
components []component.Component
}
var _ Describer = (*StubDescriber)(nil)
func NewStubDescriber(p string, components ...component.Component) *StubDescriber {
return &StubDescriber{
path: p,
components: components,
}
}
func (d *StubDescriber) Describe(context.Context, string, Options) (component.ContentResponse, error) {
return component.ContentResponse{
Components: d.components,
}, nil
}
func (d *StubDescriber) PathFilters() []PathFilter {
return []PathFilter{
*NewPathFilter(d.path, d),
}
}
func (d *StubDescriber) Reset(ctx context.Context) error {
panic("implement me")
}
func NewEmptyDescriber(p string) *StubDescriber {
return &StubDescriber{
path: p,
}
}