From a95e5d210d1be46e0f06c91f0b1a70f498b7ed29 Mon Sep 17 00:00:00 2001 From: Jose Diaz-Gonzalez Date: Sat, 28 May 2022 18:23:34 -0400 Subject: [PATCH] tests: test the command funcs to exercise app validation --- plugins/config/config_test.go | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/plugins/config/config_test.go b/plugins/config/config_test.go index ff2502fd2..63763eb66 100644 --- a/plugins/config/config_test.go +++ b/plugins/config/config_test.go @@ -64,20 +64,20 @@ func TestConfigSetMany(t *testing.T) { expectValue(testAppName, "testKey", "TESTING") - vals := map[string]string{"testKey": "updated", "testKey2": "new"} - Expect(SetMany(testAppName, vals, false)).To(Succeed()) + vals := []string{"testKey=updated", "testKey2=new"} + Expect(CommandSet(testAppName, vals, false, true, false)).To(Succeed()) expectValue(testAppName, "testKey", "updated") expectValue(testAppName, "testKey2", "new") - vals = map[string]string{"testKey": "updated_global", "testKey2": "new_global"} - Expect(SetMany("", vals, false)).To(Succeed()) + vals = []string{"testKey=updated_global", "testKey2=new_global"} + Expect(CommandSet("", vals, false, true, false)).To(Succeed()) expectValue("", "testKey", "updated_global") expectValue("", "testKey2", "new_global") expectValue("", "globalKey", "GLOBAL_VALUE") expectValue(testAppName, "testKey", "updated") expectValue(testAppName, "testKey2", "new") - Expect(SetMany(testAppName+"does_not_exist", vals, false)).ToNot(Succeed()) + Expect(CommandSet(testAppName+"does_not_exist", vals, false, true, false)).ToNot(Succeed()) } func TestConfigUnsetAll(t *testing.T) { @@ -88,12 +88,12 @@ func TestConfigUnsetAll(t *testing.T) { expectValue(testAppName, "testKey", "TESTING") expectValue("", "testKey", "GLOBAL_TESTING") - Expect(UnsetAll(testAppName, false)).To(Succeed()) + Expect(CommandClear(testAppName, false, true)).To(Succeed()) expectNoValue(testAppName, "testKey") expectNoValue(testAppName, "noKey") expectNoValue(testAppName, "globalKey") - Expect(UnsetAll(testAppName+"does-not-exist", false)).ToNot(Succeed()) + Expect(CommandClear(testAppName+"does-not-exist", false, true)).ToNot(Succeed()) } func TestConfigUnsetMany(t *testing.T) { @@ -105,15 +105,15 @@ func TestConfigUnsetMany(t *testing.T) { expectValue("", "testKey", "GLOBAL_TESTING") keys := []string{"testKey", "noKey"} - Expect(UnsetMany(testAppName, keys, false)).To(Succeed()) + Expect(CommandUnset(testAppName, keys, false, true)).To(Succeed()) expectNoValue(testAppName, "testKey") expectValue("", "testKey", "GLOBAL_TESTING") - Expect(UnsetMany(testAppName, keys, false)).To(Succeed()) + Expect(CommandUnset(testAppName, keys, false, true)).To(Succeed()) expectNoValue(testAppName, "testKey") expectNoValue(testAppName, "globalKey") - Expect(UnsetMany(testAppName+"does-not-exist", keys, false)).ToNot(Succeed()) + Expect(CommandUnset(testAppName+"does-not-exist", keys, false, true)).ToNot(Succeed()) } func TestEnvironmentLoading(t *testing.T) {