Beispiel #1
0
func (t *ModelTestSuite) SetUpTest(c *C) {
	memGraph, _ := cayley.NewMemoryGraph()
	memNg, _ := graph.NewGraph(memGraph)

	t.nodeGraph, t.tmpDir = testutils.TestInit()
	t.server = httptest.NewServer(api.NewApi(memNg))
	t.client = apiclient.ApiClient{t.server.URL, api.JsonEncoding}
}
Beispiel #2
0
func main() {
	env.InitializeEnvironment()
	if nodeGraph, err := initDb(); err != nil {
		os.Exit(1)
	} else {
		go peer.ClientHeartbeat()
		http.ListenAndServe(":3000", api.NewApi(nodeGraph))
	}
}
Beispiel #3
0
func (suite *ApiTestSuite) SetUpTest(t *C) {
	suite.ng, suite.testDir = testutils.TestInit()
	suite.server = httptest.NewServer(api.NewApi(suite.ng))
	suite.client = http.DefaultClient
}
Beispiel #4
0
func (suite *ApiClientTestSuite) SetUpTest(t *C) {
	suite.ng, suite.testDir = testutils.TestInit()
	suite.server = httptest.NewServer(api.NewApi(suite.ng))
	suite.client = apiclient.ApiClient{suite.server.URL, api.JsonEncoding}
}