From 8238644796e5d03a83591eae3dcad554fc85f5ad Mon Sep 17 00:00:00 2001 From: "Essam A. Hassan" Date: Mon, 16 Apr 2018 01:39:41 +0200 Subject: [PATCH] testing config/secrets are showing in pretty print Signed-off-by: Essam A. Hassan --- cli/command/service/inspect_test.go | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/cli/command/service/inspect_test.go b/cli/command/service/inspect_test.go index 16088b0811..41736f8894 100644 --- a/cli/command/service/inspect_test.go +++ b/cli/command/service/inspect_test.go @@ -48,12 +48,18 @@ func formatServiceInspect(t *testing.T, format formatter.Format, now time.Time) { ConfigID: "mtc3i44r1awdoziy2iceg73z8", ConfigName: "configtest.conf", + File: &swarm.ConfigReferenceFileTarget{ + Name: "/configtest.conf", + }, }, }, Secrets: []*swarm.SecretReference{ { SecretID: "3hv39ehbbb4hdozo7spod9ftn", SecretName: "secrettest.conf", + File: &swarm.SecretReferenceFileTarget{ + Name: "/secrettest.conf", + }, }, }, }, @@ -145,3 +151,10 @@ func TestJSONFormatWithNoUpdateConfig(t *testing.T) { } assert.Check(t, is.DeepEqual(m1, m2)) } + +func TestPrettyPrintWithConfigsAndSecrets(t *testing.T) { + s := formatServiceInspect(t, formatter.NewServiceFormat("pretty"), time.Now()) + + assert.Check(t, is.Contains(s, "Configs:"), "Pretty print missing configs") + assert.Check(t, is.Contains(s, "Secrets:"), "Pretty print missing secrets") +}