storj/pkg/bwagreement/test/server_test.go
Bill Thorp b2a8a10b16
redo tally query (#742)
* redo tally query

* broken, sharing w/ Jen

* tally tests added, failiing

* fix txn issue in tally

* fix lint
2018-12-05 09:03:23 -05:00

32 lines
647 B
Go

// Copyright (C) 2018 Storj Labs, Inc.
// See LICENSE for copying information.
package test
import (
"context"
"testing"
"github.com/stretchr/testify/assert"
"storj.io/storj/pkg/pb"
)
var (
ctx = context.Background()
)
func TestBandwidthAgreements(t *testing.T) {
TS := newTestServer(t)
defer TS.stop()
pba, err := GeneratePayerBandwidthAllocation(pb.PayerBandwidthAllocation_GET, TS.K)
assert.NoError(t, err)
rba, err := GenerateRenterBandwidthAllocation(pba, TS.K)
assert.NoError(t, err)
/* emulate sending the bwagreement stream from piecestore node */
_, err = TS.C.BandwidthAgreements(ctx, rba)
assert.NoError(t, err)
}