MCPcopy Create free account
hub / github.com/CrunchyData/postgres-operator / TestClusterInstance

Function TestClusterInstance

internal/naming/selectors_test.go:59–69  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

57}
58
59func TestClusterInstance(t *testing.T) {
60 s, err := AsSelector(ClusterInstance("daisy", "dog"))
61 assert.NilError(t, err)
62 assert.DeepEqual(t, s.String(), strings.Join([]string{
63 "postgres-operator.crunchydata.com/cluster=daisy",
64 "postgres-operator.crunchydata.com/instance=dog",
65 }, ","))
66
67 _, err = AsSelector(ClusterInstance("--whoa/son", "--whoa/yikes"))
68 assert.ErrorContains(t, err, "Invalid")
69}
70
71func TestClusterInstances(t *testing.T) {
72 s, err := AsSelector(ClusterInstances("something"))

Callers

nothing calls this directly

Calls 3

AsSelectorFunction · 0.85
ClusterInstanceFunction · 0.85
StringMethod · 0.45

Tested by

no test coverage detected