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} }
func main() { env.InitializeEnvironment() if nodeGraph, err := initDb(); err != nil { os.Exit(1) } else { go peer.ClientHeartbeat() http.ListenAndServe(":3000", api.NewApi(nodeGraph)) } }
func (suite *ApiTestSuite) SetUpTest(t *C) { suite.ng, suite.testDir = testutils.TestInit() suite.server = httptest.NewServer(api.NewApi(suite.ng)) suite.client = http.DefaultClient }
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} }