Progress on data source admin

This commit is contained in:
Torkel Ödegaard
2014-12-16 16:45:07 +01:00
parent b70a3f0958
commit 27f07e9de2
10 changed files with 106 additions and 72 deletions

View File

@@ -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
// }