This commit is contained in:
simon987
2019-01-12 19:52:51 -05:00
parent 83276ce8b0
commit a2b5de0e01
10 changed files with 490 additions and 109 deletions

View File

@@ -3,6 +3,7 @@ package test
import (
"encoding/json"
"fmt"
"github.com/google/uuid"
"io/ioutil"
"net/http"
"src/task_tracker/api"
@@ -21,13 +22,13 @@ func TestCreateGetWorker(t *testing.T) {
t.Fail()
}
getResp, r := getWorker(resp.WorkerId)
getResp, r := getWorker(resp.WorkerId.String())
if r.StatusCode != 200 {
t.Fail()
}
if resp.WorkerId != getResp.Worker.Id.String() {
if resp.WorkerId != getResp.Worker.Id {
t.Fail()
}
}
@@ -81,3 +82,9 @@ func getWorker(id string) (*api.GetWorkerResponse, *http.Response) {
return resp, r
}
func genWid() *uuid.UUID {
resp, _ := createWorker(api.CreateWorkerRequest{})
return &resp.WorkerId
}