tests: test the command funcs to exercise app validation
This commit is contained in:
1 parent
96a2ec01f5
commit
a95e5d210d
1 file changed
+10
-10
@@ -64,20 +64,20 @@ func TestConfigSetMany(t *testing.T) {
|
|||||||
|
|
||||||
expectValue(testAppName, "testKey", "TESTING")
|
expectValue(testAppName, "testKey", "TESTING")
|
||||||
|
|
||||||
vals := map[string]string{"testKey": "updated", "testKey2": "new"}
|
vals := []string{"testKey=updated", "testKey2=new"}
|
||||||
Expect(SetMany(testAppName, vals, false)).To(Succeed())
|
Expect(CommandSet(testAppName, vals, false, true, false)).To(Succeed())
|
||||||
expectValue(testAppName, "testKey", "updated")
|
expectValue(testAppName, "testKey", "updated")
|
||||||
expectValue(testAppName, "testKey2", "new")
|
expectValue(testAppName, "testKey2", "new")
|
||||||
|
|
||||||
vals = map[string]string{"testKey": "updated_global", "testKey2": "new_global"}
|
vals = []string{"testKey=updated_global", "testKey2=new_global"}
|
||||||
Expect(SetMany("", vals, false)).To(Succeed())
|
Expect(CommandSet("", vals, false, true, false)).To(Succeed())
|
||||||
expectValue("", "testKey", "updated_global")
|
expectValue("", "testKey", "updated_global")
|
||||||
expectValue("", "testKey2", "new_global")
|
expectValue("", "testKey2", "new_global")
|
||||||
expectValue("", "globalKey", "GLOBAL_VALUE")
|
expectValue("", "globalKey", "GLOBAL_VALUE")
|
||||||
expectValue(testAppName, "testKey", "updated")
|
expectValue(testAppName, "testKey", "updated")
|
||||||
expectValue(testAppName, "testKey2", "new")
|
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) {
|
func TestConfigUnsetAll(t *testing.T) {
|
||||||
@@ -88,12 +88,12 @@ func TestConfigUnsetAll(t *testing.T) {
|
|||||||
expectValue(testAppName, "testKey", "TESTING")
|
expectValue(testAppName, "testKey", "TESTING")
|
||||||
expectValue("", "testKey", "GLOBAL_TESTING")
|
expectValue("", "testKey", "GLOBAL_TESTING")
|
||||||
|
|
||||||
Expect(UnsetAll(testAppName, false)).To(Succeed())
|
Expect(CommandClear(testAppName, false, true)).To(Succeed())
|
||||||
expectNoValue(testAppName, "testKey")
|
expectNoValue(testAppName, "testKey")
|
||||||
expectNoValue(testAppName, "noKey")
|
expectNoValue(testAppName, "noKey")
|
||||||
expectNoValue(testAppName, "globalKey")
|
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) {
|
func TestConfigUnsetMany(t *testing.T) {
|
||||||
@@ -105,15 +105,15 @@ func TestConfigUnsetMany(t *testing.T) {
|
|||||||
expectValue("", "testKey", "GLOBAL_TESTING")
|
expectValue("", "testKey", "GLOBAL_TESTING")
|
||||||
|
|
||||||
keys := []string{"testKey", "noKey"}
|
keys := []string{"testKey", "noKey"}
|
||||||
Expect(UnsetMany(testAppName, keys, false)).To(Succeed())
|
Expect(CommandUnset(testAppName, keys, false, true)).To(Succeed())
|
||||||
expectNoValue(testAppName, "testKey")
|
expectNoValue(testAppName, "testKey")
|
||||||
expectValue("", "testKey", "GLOBAL_TESTING")
|
expectValue("", "testKey", "GLOBAL_TESTING")
|
||||||
|
|
||||||
Expect(UnsetMany(testAppName, keys, false)).To(Succeed())
|
Expect(CommandUnset(testAppName, keys, false, true)).To(Succeed())
|
||||||
expectNoValue(testAppName, "testKey")
|
expectNoValue(testAppName, "testKey")
|
||||||
expectNoValue(testAppName, "globalKey")
|
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) {
|
func TestEnvironmentLoading(t *testing.T) {
|
||||||
|
|||||||
Reference in new issue
Block a user