mirror of
https://github.com/dragonheim/gagent.git
synced 2025-04-28 07:58:59 -07:00
fix: modified to fix some of the test failures.
This commit is contained in:
parent
bdeaf2ec92
commit
8f77f2258c
7 changed files with 8 additions and 8 deletions
|
@ -9,7 +9,7 @@ import (
|
|||
gstructs "github.com/dragonheim/gagent/internal/gstructs"
|
||||
)
|
||||
|
||||
const testChainDBPath = "test_chaindb.hcl"
|
||||
const testChainDBPath = "/tmp/test_chaindb.hcl"
|
||||
|
||||
func TestGagentDb(t *testing.T) {
|
||||
// Create a new GagentDb
|
||||
|
|
|
@ -29,7 +29,7 @@ func Main(wg *sync.WaitGroup, config gstructs.GagentConfig) {
|
|||
log.Printf("[INFO] Starting router\n")
|
||||
defer wg.Done()
|
||||
|
||||
http.HandleFunc("/hello", answerClient)
|
||||
http.HandleFunc("/hello", AnswerClient)
|
||||
clientSock, _ := zmq.NewSocket(zmq.ROUTER)
|
||||
defer clientSock.Close()
|
||||
|
||||
|
@ -143,7 +143,7 @@ func unwrap(msg []string) (head string, tail []string) {
|
|||
return
|
||||
}
|
||||
|
||||
func answerClient(w http.ResponseWriter, r *http.Request) {
|
||||
func AnswerClient(w http.ResponseWriter, r *http.Request) {
|
||||
if r.URL.Path != "/" {
|
||||
http.NotFound(w, r)
|
||||
return
|
||||
|
|
|
@ -41,7 +41,7 @@ func TestSetupMain(t *testing.T) {
|
|||
}
|
||||
|
||||
func captureOutput(f func()) string {
|
||||
original := *log.Writer()
|
||||
original := log.Writer()
|
||||
r, w, _ := os.Pipe()
|
||||
log.SetOutput(w)
|
||||
|
||||
|
|
|
@ -49,7 +49,7 @@ func TestWorkerMain(t *testing.T) {
|
|||
}
|
||||
|
||||
func captureOutput(f func()) string {
|
||||
original := *log.Writer()
|
||||
original := log.Writer()
|
||||
r, w, _ := os.Pipe()
|
||||
log.SetOutput(w)
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue