MCPcopy
hub / github.com/redspread/spread / TestNoDuplicateNames

Function TestNoDuplicateNames

pkg/deploy/deployment_test.go:48–60  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

46}
47
48func TestNoDuplicateNames(t *testing.T) {
49 secretA := createSecret("secret-a", "some data")
50 secretB := createSecret("secret-a", "different data")
51
52 deployment := new(Deployment)
53 assert.NoError(t, deployment.Add(secretA), "valid add")
54 assert.Error(t, deployment.Add(secretA), "duplicate name")
55 assert.Error(t, deployment.Add(secretB), "duplicate name")
56
57 // different namespace is okay though
58 secretB.Namespace = "somewhere-else"
59 assert.NoError(t, deployment.Add(secretB), "same name / different namespace")
60}
61
62func TestDeploymentObjects(t *testing.T) {
63 secret1, secret2 := createSecret("secret1", "dpn't tell"), createSecret("secret2", "spoilers!")

Callers

nothing calls this directly

Calls 2

createSecretFunction · 0.70
AddMethod · 0.45

Tested by

no test coverage detected