mirror of
				https://github.com/optim-enterprises-bv/vault.git
				synced 2025-11-03 03:58:01 +00:00 
			
		
		
		
	http: help
This commit is contained in:
		
							
								
								
									
										27
									
								
								http/help_test.go
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										27
									
								
								http/help_test.go
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,27 @@
 | 
			
		||||
package http
 | 
			
		||||
 | 
			
		||||
import (
 | 
			
		||||
	"net/http"
 | 
			
		||||
	"testing"
 | 
			
		||||
 | 
			
		||||
	"github.com/hashicorp/vault/vault"
 | 
			
		||||
)
 | 
			
		||||
 | 
			
		||||
func TestHelp(t *testing.T) {
 | 
			
		||||
	core, _, token := vault.TestCoreUnsealed(t)
 | 
			
		||||
	ln, addr := TestServer(t, core)
 | 
			
		||||
	defer ln.Close()
 | 
			
		||||
	TestServerAuth(t, addr, token)
 | 
			
		||||
 | 
			
		||||
	resp, err := http.Get(addr + "/v1/sys/mounts?help=1")
 | 
			
		||||
	if err != nil {
 | 
			
		||||
		t.Fatalf("err: %s", err)
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
	var actual map[string]interface{}
 | 
			
		||||
	testResponseStatus(t, resp, 200)
 | 
			
		||||
	testResponseBody(t, resp, &actual)
 | 
			
		||||
	if _, ok := actual["help"]; !ok {
 | 
			
		||||
		t.Fatalf("bad: %#v", actual)
 | 
			
		||||
	}
 | 
			
		||||
}
 | 
			
		||||
		Reference in New Issue
	
	Block a user