github.com/go/docker@v1.12.0-rc2/cmd/docker/docker_test.go (about)

     1  package main
     2  
     3  import (
     4  	"os"
     5  	"testing"
     6  
     7  	"github.com/Sirupsen/logrus"
     8  	"github.com/docker/docker/utils"
     9  )
    10  
    11  func TestClientDebugEnabled(t *testing.T) {
    12  	defer utils.DisableDebug()
    13  
    14  	clientFlags.Common.FlagSet.Parse([]string{"-D"})
    15  	clientFlags.PostParse()
    16  
    17  	if os.Getenv("DEBUG") != "1" {
    18  		t.Fatal("expected debug enabled, got false")
    19  	}
    20  	if logrus.GetLevel() != logrus.DebugLevel {
    21  		t.Fatalf("expected logrus debug level, got %v", logrus.GetLevel())
    22  	}
    23  }