mirror of https://github.com/grafana/grafana
parent
b70a3f0958
commit
27f07e9de2
@ -1 +1 @@ |
||||
Subproject commit b3b096e204a8ad6eb2aba6b98802589ab3d1fa28 |
||||
Subproject commit adb1502e728e5a312a6e4dc680edbd1f75219ea1 |
@ -1,34 +1,35 @@ |
||||
package renderer |
||||
|
||||
import ( |
||||
"io/ioutil" |
||||
"os" |
||||
"testing" |
||||
|
||||
. "github.com/smartystreets/goconvey/convey" |
||||
) |
||||
|
||||
func TestPhantomRender(t *testing.T) { |
||||
|
||||
Convey("Can render url", t, func() { |
||||
tempDir, _ := ioutil.TempDir("", "img") |
||||
png, err := RenderToPng("http://www.google.com") |
||||
So(err, ShouldBeNil) |
||||
So(exists(png), ShouldEqual, true) |
||||
|
||||
//_, err = os.Stat(store.getFilePathForDashboard("hello"))
|
||||
//So(err, ShouldBeNil)
|
||||
}) |
||||
|
||||
} |
||||
|
||||
func exists(path string) bool { |
||||
_, err := os.Stat(path) |
||||
if err == nil { |
||||
return true |
||||
} |
||||
if os.IsNotExist(err) { |
||||
return false |
||||
} |
||||
return false |
||||
} |
||||
//
|
||||
// import (
|
||||
// "io/ioutil"
|
||||
// "os"
|
||||
// "testing"
|
||||
//
|
||||
// . "github.com/smartystreets/goconvey/convey"
|
||||
// )
|
||||
//
|
||||
// func TestPhantomRender(t *testing.T) {
|
||||
//
|
||||
// Convey("Can render url", t, func() {
|
||||
// tempDir, _ := ioutil.TempDir("", "img")
|
||||
// ipng, err := RenderToPng("http://www.google.com")
|
||||
// So(err, ShouldBeNil)
|
||||
// So(exists(png), ShouldEqual, true)
|
||||
//
|
||||
// //_, err = os.Stat(store.getFilePathForDashboard("hello"))
|
||||
// //So(err, ShouldBeNil)
|
||||
// })
|
||||
//
|
||||
// }
|
||||
//
|
||||
// func exists(path string) bool {
|
||||
// _, err := os.Stat(path)
|
||||
// if err == nil {
|
||||
// return true
|
||||
// }
|
||||
// if os.IsNotExist(err) {
|
||||
// return false
|
||||
// }
|
||||
// return false
|
||||
// }
|
||||
|
Loading…
Reference in new issue