Skip to content

Commit

Permalink
fix nits
Browse files Browse the repository at this point in the history
  • Loading branch information
vgonkivs committed Nov 25, 2024
1 parent 47d2cb0 commit 617b1c6
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 13 deletions.
17 changes: 4 additions & 13 deletions nodebuilder/tests/api_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ import (
"bytes"
"context"
"fmt"
"io"
"net/http"
"os"
"testing"
Expand Down Expand Up @@ -194,30 +193,22 @@ func TestSubmitBlobOverHTTP(t *testing.T) {
err := bridge.Start(ctx)
require.NoError(t, err)

bridgeAddr := "http://" + bridge.RPCServer.ListenAddr()

adminPerms := []auth.Permission{"public", "read", "write", "admin"}
jwt, err := bridge.AdminServ.AuthNew(ctx, adminPerms)
require.NoError(t, err)

f, err := os.Open("test_data/submitPFB.json")
require.NoError(t, err)
defer f.Close()

payload, err := io.ReadAll(f)
payload, err := os.ReadFile("testdata/submitPFB.json")
require.NoError(t, err)

bridgeAddr := "http://" + bridge.RPCServer.ListenAddr()
req, err := http.NewRequest("POST", bridgeAddr, bytes.NewBuffer(payload))
if err != nil {
fmt.Printf("Failed to create request: %v\n", err)
return
}
require.NoError(t, err)

req.Header = http.Header{
perms.AuthKey: []string{fmt.Sprintf("Bearer %s", jwt)},
}

httpClient := &http.Client{}
httpClient := &http.Client{Timeout: time.Second * 5}
resp, err := httpClient.Do(req)
require.NoError(t, err)
defer resp.Body.Close()
Expand Down
File renamed without changes.

0 comments on commit 617b1c6

Please sign in to comment.