Skip to content

Commit

Permalink
removes testify
Browse files Browse the repository at this point in the history
Signed-off-by: Owen Diehl <ow.diehl@gmail.com>
  • Loading branch information
owen-d committed May 10, 2021
1 parent b5fe917 commit ba72cc9
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 13 deletions.
6 changes: 3 additions & 3 deletions config/config_test.go
Expand Up @@ -18,8 +18,6 @@ package config
import (
"encoding/json"
"testing"

"github.com/stretchr/testify/require"
)

func TestJSONMarshalSecret(t *testing.T) {
Expand Down Expand Up @@ -49,7 +47,9 @@ func TestJSONMarshalSecret(t *testing.T) {
if err != nil {
t.Fatal(err)
}
require.Equal(t, tc.expected, string(c), "Secret not properly elided.")
if tc.expected != string(c) {
t.Fatalf("Secret not marshaled correctly, got '%s'", string(c))
}
})
}
}
17 changes: 12 additions & 5 deletions config/http_config_test.go
Expand Up @@ -37,7 +37,6 @@ import (
"testing"
"time"

"github.com/stretchr/testify/require"
yaml "gopkg.in/yaml.v2"
)

Expand Down Expand Up @@ -1290,13 +1289,17 @@ func TestMarshalURL(t *testing.T) {
if err != nil {
t.Fatal(err)
}
require.Equal(t, "\"http://example.com/\"", string(c), "URL not properly marshaled in JSON.")
if string(c) != "\"http://example.com/\"" {
t.Fatalf("URL not properly marshaled in JSON got '%s'", string(c))
}

c, err = yaml.Marshal(u)
if err != nil {
t.Fatal(err)
}
require.Equal(t, "http://example.com/\n", string(c), "URL not properly marshaled in YAML.")
if string(c) != "http://example.com/\n" {
t.Fatalf("URL not properly marshaled in YAML got '%s'", string(c))
}
}

func TestUnmarshalURL(t *testing.T) {
Expand All @@ -1307,11 +1310,15 @@ func TestUnmarshalURL(t *testing.T) {
if err != nil {
t.Fatal(err)
}
require.Equal(t, "http://example.com/a%20b", u.String(), "URL not properly unmarshaled in JSON.")
if u.String() != "http://example.com/a%20b" {
t.Fatalf("URL not properly unmarshaled in JSON, got '%s'", u.String())
}

err = yaml.Unmarshal(b, &u)
if err != nil {
t.Fatal(err)
}
require.Equal(t, "http://example.com/a%20b", u.String(), "URL not properly unmarshaled in YAML.")
if u.String() != "http://example.com/a%20b" {
t.Fatalf("URL not properly unmarshaled in YAML, got '%s'", u.String())
}
}
1 change: 0 additions & 1 deletion go.mod
Expand Up @@ -12,7 +12,6 @@ require (
github.com/prometheus/client_golang v1.7.1
github.com/prometheus/client_model v0.2.0
github.com/sirupsen/logrus v1.6.0
github.com/stretchr/testify v1.7.0
golang.org/x/net v0.0.0-20200625001655-4c5254603344
golang.org/x/oauth2 v0.0.0-20190226205417-e64efc72b421
golang.org/x/sys v0.0.0-20200625212154-ddb9806d33ae
Expand Down
5 changes: 1 addition & 4 deletions go.sum
Expand Up @@ -261,9 +261,8 @@ github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+
github.com/stretchr/objx v0.1.1/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME=
github.com/stretchr/testify v1.2.2/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs=
github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI=
github.com/stretchr/testify v1.4.0 h1:2E4SXV/wtOkTonXsotYi4li6zVWxYlZuYNCXe9XRJyk=
github.com/stretchr/testify v1.4.0/go.mod h1:j7eGeouHqKxXV5pUuKE4zz7dFj8WfuZ+81PSLYec5m4=
github.com/stretchr/testify v1.7.0 h1:nwc3DEeHmmLAfoZucVR881uASk0Mfjw8xYJ99tb5CcY=
github.com/stretchr/testify v1.7.0/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg=
github.com/tmc/grpc-websocket-proxy v0.0.0-20170815181823-89b8d40f7ca8/go.mod h1:ncp9v5uamzpCO7NfCPTXjqaC+bZgJeR0sMTm6dMHP7U=
github.com/urfave/cli v1.20.0/go.mod h1:70zkFmudgCuE/ngEzBv17Jvp/497gISqfk5gWijbERA=
github.com/urfave/cli v1.22.1/go.mod h1:Gos4lmkARVdJ6EkW0WaNv/tZAAMe9V7XWyB60NtXRu0=
Expand Down Expand Up @@ -410,8 +409,6 @@ gopkg.in/yaml.v2 v2.2.4/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
gopkg.in/yaml.v2 v2.2.5/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
gopkg.in/yaml.v2 v2.3.0 h1:clyUAQHOM3G0M3f5vQj7LuJrETvjVot3Z5el9nffUtU=
gopkg.in/yaml.v2 v2.3.0/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c h1:dUUwHk2QECo/6vqA44rthZ8ie2QXMNeKRTHCNY2nXvo=
gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=
honnef.co/go/tools v0.0.0-20180728063816-88497007e858/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4=
honnef.co/go/tools v0.0.0-20190102054323-c2f93a96b099/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4=
honnef.co/go/tools v0.0.0-20190523083050-ea95bdfd59fc/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4=
Expand Down

0 comments on commit ba72cc9

Please sign in to comment.