test: remove go-cmp dependency (#213)

This commit is contained in:
Daniel Moran 2021-07-29 12:16:23 -04:00 committed by GitHub
parent e2bd0a0a12
commit c6f55368ea
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 5 additions and 10 deletions

View File

@ -11,7 +11,6 @@ import (
"time"
"github.com/golang/mock/gomock"
"github.com/google/go-cmp/cmp"
"github.com/influxdata/influx-cli/v2/api"
"github.com/influxdata/influx-cli/v2/clients"
"github.com/influxdata/influx-cli/v2/clients/bucket_schema"
@ -132,7 +131,7 @@ func TestClient_Create(t *testing.T) {
a.schemas.EXPECT().
CreateMeasurementSchemaExecute(tmock.MatchedBy(func(in api.ApiCreateMeasurementSchemaRequest) bool {
orgIDPtr := orgID.String()
return cmp.Equal(in.GetOrgID(), &orgIDPtr) && cmp.Equal(in.GetBucketID(), bucketID.String())
return assert.Equal(t, in.GetOrgID(), &orgIDPtr) && assert.Equal(t, in.GetBucketID(), bucketID.String())
})).
Return(api.MeasurementSchema{
Id: measurementID.String(),

View File

@ -11,7 +11,6 @@ import (
"time"
"github.com/golang/mock/gomock"
"github.com/google/go-cmp/cmp"
"github.com/influxdata/influx-cli/v2/api"
"github.com/influxdata/influx-cli/v2/clients"
"github.com/influxdata/influx-cli/v2/clients/bucket_schema"
@ -163,10 +162,10 @@ func TestClient_Update(t *testing.T) {
a.schemas.EXPECT().
UpdateMeasurementSchemaExecute(tmock.MatchedBy(func(in api.ApiUpdateMeasurementSchemaRequest) bool {
orgIDPtr := orgID.String()
return cmp.Equal(in.GetOrgID(), &orgIDPtr) &&
cmp.Equal(in.GetBucketID(), bucketID.String()) &&
cmp.Equal(in.GetMeasurementID(), measurementID.String()) &&
cmp.Equal(in.GetMeasurementSchemaUpdateRequest().Columns, a.cols)
return assert.Equal(t, in.GetOrgID(), &orgIDPtr) &&
assert.Equal(t, in.GetBucketID(), bucketID.String()) &&
assert.Equal(t, in.GetMeasurementID(), measurementID.String()) &&
assert.Equal(t, in.GetMeasurementSchemaUpdateRequest().Columns, a.cols)
})).
Return(api.MeasurementSchema{
Id: measurementID.String(),

1
go.mod
View File

@ -12,7 +12,6 @@ require (
github.com/gocarina/gocsv v0.0.0-20210408192840-02d7211d929d
github.com/gogo/protobuf v1.3.2
github.com/golang/mock v1.5.0
github.com/google/go-cmp v0.5.5
github.com/google/go-jsonnet v0.17.0
github.com/mattn/go-isatty v0.0.13
github.com/olekukonko/tablewriter v0.0.5

2
go.sum
View File

@ -25,8 +25,6 @@ github.com/gogo/protobuf v1.3.2 h1:Ov1cvc58UF3b5XjBnZv7+opcTcQFZebYjWzi34vdm4Q=
github.com/gogo/protobuf v1.3.2/go.mod h1:P1XiOD3dCwIKUDQYPy72D8LYyHL2YPYrpS2s69NZV8Q=
github.com/golang/mock v1.5.0 h1:jlYHihg//f7RRwuPfptm04yp4s7O6Kw8EZiVYIGcH0g=
github.com/golang/mock v1.5.0/go.mod h1:CWnOUgYIOo4TcNZ0wHX3YZCqsaM1I1Jvs6v3mP3KVu8=
github.com/google/go-cmp v0.5.5 h1:Khx7svrCpmxxtHBq5j2mp/xVjsi8hQMfNLvJFAlrGgU=
github.com/google/go-cmp v0.5.5/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE=
github.com/google/go-jsonnet v0.17.0 h1:/9NIEfhK1NQRKl3sP2536b2+x5HnZMdql7x3yK/l8JY=
github.com/google/go-jsonnet v0.17.0/go.mod h1:sOcuej3UW1vpPTZOr8L7RQimqai1a57bt5j22LzGZCw=
github.com/hinshun/vt10x v0.0.0-20180616224451-1954e6464174 h1:WlZsjVhE8Af9IcZDGgJGQpNflI3+MJSBhsgT5PCtzBQ=