more macaroon stuff

This commit is contained in:
Torkel Ödegaard
2014-10-07 11:53:25 -04:00
parent 222319d924
commit e84f06b503
17 changed files with 343 additions and 11 deletions
+34
View File
@@ -0,0 +1,34 @@
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
}