Skip to content

Commit

Permalink
add test
Browse files Browse the repository at this point in the history
  • Loading branch information
tukeJonny committed Nov 2, 2023
1 parent 1ea1e3c commit 7048256
Showing 1 changed file with 30 additions and 0 deletions.
30 changes: 30 additions & 0 deletions bench/isupipe/client_livestream_test.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,33 @@
package isupipe

import (
"context"
"testing"

"github.com/isucon/isucandar/agent"
"github.com/isucon/isucon13/bench/internal/config"
"github.com/isucon/isucon13/bench/internal/scheduler"
"github.com/stretchr/testify/assert"
)

// FIXME: 予約期間、枠数などテスト

func TestLivestreamSearch(t *testing.T) {
ctx := context.Background()

client, err := NewClient(
agent.WithBaseURL(config.TargetBaseURL),
)
assert.NoError(t, err)

user := scheduler.UserScheduler.GetRandomStreamer()
err = client.Login(ctx, &LoginRequest{
UserName: user.Name,
Password: user.RawPassword,
})
assert.NoError(t, err)

livestreams, err := client.SearchLivestreams(ctx)
assert.NoError(t, err)
assert.NotZero(t, len(livestreams))
}

0 comments on commit 7048256

Please sign in to comment.