37 lines
552 B
Go
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) {
|
|
|
|
}
|
|
|
|
|