crawler_go/crawler_test.go
jackdaw@loafle.com 5e6410451c example config
2017-04-13 15:36:28 +09:00

37 lines
552 B
Go

package crawler
import (
"testing"
"encoding/json"
"github.com/stretchr/testify/assert"
)
func initConfig() CrawlerImpl{
c := CrawlerImpl{}
c.Init("/root/gowork/src/loafle.com/overflow/crawler_go/config/")
return c
}
func TestCrawlerInit(t *testing.T) {
c := initConfig()
m := c.configs["example.json"].(map[string]interface{})
assert.Equal(t, m["id"].(string) , "SOEJWEOJWOEJOSDJFOASDJFOSDFO2903870928734")
}
func TestCrawlerAdd(t *testing.T) {
}
func TestCrawlerRemove(t *testing.T) {
}
func TestCrawlerGet(t *testing.T) {
}