Пример #1
0
func testConfigClear(t *testing.T, g *libkb.GlobalContext, path string, wantErr bool) {
	set := client.NewCmdConfigSetRunner(g)
	set.Path = path
	set.DoClear = true
	err := set.Run()
	if wantErr && err == nil {
		t.Fatal("Expected an error")
	}
	if !wantErr && err != nil {
		t.Fatalf("Wanted no error, but got: %v", err)
	}
}
Пример #2
0
func testConfigSet(t *testing.T, g *libkb.GlobalContext, path string, val keybase1.ConfigValue, wantErr bool) {
	set := client.NewCmdConfigSetRunner(g)
	set.Path = path
	set.Value = val
	err := set.Run()
	if wantErr && err == nil {
		t.Fatal("Expected an error")
	}
	if !wantErr && err != nil {
		t.Fatalf("Wanted no error, but got: %v", err)
	}
}