Skip to content

Commit

Permalink
User-Agentの指定 (#16)
Browse files Browse the repository at this point in the history
  • Loading branch information
yamamoto-febc committed Mar 24, 2022
1 parent fa47293 commit 2118735
Show file tree
Hide file tree
Showing 7 changed files with 35 additions and 0 deletions.
5 changes: 5 additions & 0 deletions account/accesskey/service_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,12 @@ import (
"testing"
"time"

client "github.com/sacloud/api-client-go"
objectstorage "github.com/sacloud/object-storage-api-go"
v1 "github.com/sacloud/object-storage-api-go/apis/v1"
"github.com/sacloud/object-storage-api-go/fake"
"github.com/sacloud/object-storage-api-go/fake/server"
service "github.com/sacloud/object-storage-service-go"
"github.com/stretchr/testify/require"
)

Expand All @@ -35,6 +37,9 @@ func TestAccountAccessKey_CRUD_plus_L(t *testing.T) {
fakeServer := initFakeServer()
client := &objectstorage.Client{
APIRootURL: fakeServer.URL,
Options: &client.Options{
UserAgent: service.UserAgent,
},
}

svc := New(client)
Expand Down
5 changes: 5 additions & 0 deletions account/service_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,12 @@ import (
"net/http/httptest"
"testing"

client "github.com/sacloud/api-client-go"
objectstorage "github.com/sacloud/object-storage-api-go"
v1 "github.com/sacloud/object-storage-api-go/apis/v1"
"github.com/sacloud/object-storage-api-go/fake"
"github.com/sacloud/object-storage-api-go/fake/server"
service "github.com/sacloud/object-storage-service-go"
"github.com/stretchr/testify/require"
)

Expand All @@ -31,6 +33,9 @@ func TestAccount_CRUD_plus_L(t *testing.T) {
server := initFakeServer()
client := &objectstorage.Client{
APIRootURL: server.URL,
Options: &client.Options{
UserAgent: service.UserAgent,
},
}
svc := New(client)
var account *v1.Account
Expand Down
5 changes: 5 additions & 0 deletions permission/accesskey/service_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,12 @@ import (
"net/http/httptest"
"testing"

client "github.com/sacloud/api-client-go"
objectstorage "github.com/sacloud/object-storage-api-go"
v1 "github.com/sacloud/object-storage-api-go/apis/v1"
"github.com/sacloud/object-storage-api-go/fake"
"github.com/sacloud/object-storage-api-go/fake/server"
service "github.com/sacloud/object-storage-service-go"
"github.com/stretchr/testify/require"
)

Expand All @@ -34,6 +36,9 @@ func TestPermissionAccessKey_CRUD_plus_L(t *testing.T) {
fakeServer := initFakeServer()
client := &objectstorage.Client{
APIRootURL: fakeServer.URL,
Options: &client.Options{
UserAgent: service.UserAgent,
},
}

svc := New(client)
Expand Down
5 changes: 5 additions & 0 deletions permission/bucketcontrol/service_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,12 @@ import (
"net/http/httptest"
"testing"

client "github.com/sacloud/api-client-go"
objectstorage "github.com/sacloud/object-storage-api-go"
v1 "github.com/sacloud/object-storage-api-go/apis/v1"
"github.com/sacloud/object-storage-api-go/fake"
"github.com/sacloud/object-storage-api-go/fake/server"
service "github.com/sacloud/object-storage-service-go"
"github.com/sacloud/packages-go/pointer"
"github.com/sacloud/packages-go/testutil"
"github.com/stretchr/testify/require"
Expand All @@ -35,6 +37,9 @@ func TestPermissionBucketControl_CRUD_plus_L(t *testing.T) {
fakeServer := initFakeServer()
client := &objectstorage.Client{
APIRootURL: fakeServer.URL,
Options: &client.Options{
UserAgent: service.UserAgent,
},
}
svc := New(client)
var bucketControl *v1.BucketControl
Expand Down
5 changes: 5 additions & 0 deletions permission/service_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,12 @@ import (
"net/http/httptest"
"testing"

client "github.com/sacloud/api-client-go"
objectstorage "github.com/sacloud/object-storage-api-go"
v1 "github.com/sacloud/object-storage-api-go/apis/v1"
"github.com/sacloud/object-storage-api-go/fake"
"github.com/sacloud/object-storage-api-go/fake/server"
service "github.com/sacloud/object-storage-service-go"
"github.com/sacloud/packages-go/pointer"
"github.com/sacloud/packages-go/testutil"
"github.com/stretchr/testify/require"
Expand All @@ -33,6 +35,9 @@ func TestPermission_CRUD_plus_L(t *testing.T) {
server := initFakeServer()
client := &objectstorage.Client{
APIRootURL: server.URL,
Options: &client.Options{
UserAgent: service.UserAgent,
},
}
svc := New(client)
var permission *v1.Permission
Expand Down
5 changes: 5 additions & 0 deletions site/service_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,12 @@ import (
"net/http/httptest"
"testing"

client "github.com/sacloud/api-client-go"
objectstorage "github.com/sacloud/object-storage-api-go"
v1 "github.com/sacloud/object-storage-api-go/apis/v1"
"github.com/sacloud/object-storage-api-go/fake"
"github.com/sacloud/object-storage-api-go/fake/server"
service "github.com/sacloud/object-storage-service-go"
"github.com/stretchr/testify/require"
)

Expand All @@ -31,6 +33,9 @@ func TestSite_CRUD_plus_L(t *testing.T) {
server := initFakeServer()
client := &objectstorage.Client{
APIRootURL: server.URL,
Options: &client.Options{
UserAgent: service.UserAgent,
},
}
svc := New(client)
var site *v1.Cluster
Expand Down
5 changes: 5 additions & 0 deletions site/status/service_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,12 @@ import (
"net/http/httptest"
"testing"

client "github.com/sacloud/api-client-go"
objectstorage "github.com/sacloud/object-storage-api-go"
v1 "github.com/sacloud/object-storage-api-go/apis/v1"
"github.com/sacloud/object-storage-api-go/fake"
"github.com/sacloud/object-storage-api-go/fake/server"
service "github.com/sacloud/object-storage-service-go"
"github.com/stretchr/testify/require"
)

Expand All @@ -31,6 +33,9 @@ func TestSiteStatus_CRUD_plus_L(t *testing.T) {
server := initFakeServer()
client := &objectstorage.Client{
APIRootURL: server.URL,
Options: &client.Options{
UserAgent: service.UserAgent,
},
}
svc := New(client)

Expand Down

0 comments on commit 2118735

Please sign in to comment.