github.com/portworx/docker@v1.12.1/volume/drivers/extpoint_test.go (about) 1 package volumedrivers 2 3 import ( 4 "testing" 5 6 "github.com/docker/docker/volume/testutils" 7 ) 8 9 func TestGetDriver(t *testing.T) { 10 _, err := GetDriver("missing") 11 if err == nil { 12 t.Fatal("Expected error, was nil") 13 } 14 15 Register(volumetestutils.NewFakeDriver("fake"), "fake") 16 d, err := GetDriver("fake") 17 if err != nil { 18 t.Fatal(err) 19 } 20 if d.Name() != "fake" { 21 t.Fatalf("Expected fake driver, got %s\n", d.Name()) 22 } 23 }