summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--go.mod6
-rw-r--r--go.sum4
-rw-r--r--src/oauth/auth_header_test.go22
3 files changed, 16 insertions, 16 deletions
diff --git a/go.mod b/go.mod
index 79f7108..75c3cb3 100644
--- a/go.mod
+++ b/go.mod
@@ -2,8 +2,4 @@ module codeberg.org/dijitol/trading_post
replace codeberg.org/dijitol/trading_post => ./
-go 1.26.5
-
-require github.com/stretchr/testify v1.12.1
-
-require go.yaml.in/yaml/v3 v3.0.5 // indirect
+go 1.26.7
diff --git a/go.sum b/go.sum
index c233683..e69de29 100644
--- a/go.sum
+++ b/go.sum
@@ -1,4 +0,0 @@
-github.com/stretchr/testify v1.12.1 h1:EuwCh5fleGS7H32xRwO3wRGT7DxrDhLAT6FF8MpWDWE=
-github.com/stretchr/testify v1.12.1/go.mod h1:MDEgiDPPsNp5cuIrHPPCyornHKgEVbtFUmoNlxoYthg=
-go.yaml.in/yaml/v3 v3.0.5 h1:N6y/pJk8buWs9NY5ERU2HSMfm+IuD/OtfdAnq6kESPw=
-go.yaml.in/yaml/v3 v3.0.5/go.mod h1:HVTZu1O7/Vkt2N+BFy8Zza+lnLsABggaTM2ZpNIGuKg=
diff --git a/src/oauth/auth_header_test.go b/src/oauth/auth_header_test.go
index 332b3de..78e568c 100644
--- a/src/oauth/auth_header_test.go
+++ b/src/oauth/auth_header_test.go
@@ -4,8 +4,6 @@ import (
"net/http"
"strings"
"testing"
-
- "github.com/stretchr/testify/assert"
)
func TestString_CardmarketDemoValues_Success(t *testing.T) {
@@ -45,7 +43,9 @@ func TestString_CardmarketDemoValues_Success(t *testing.T) {
actual := ah.String()
// Assert
- assert.True(t, strings.HasPrefix(actual, "OAuth "))
+ if !strings.HasPrefix(actual, "OAuth ") {
+ t.Errorf(`expected %q to be prefixed with "OAuth "`, actual)
+ }
actualParts := strings.Split(strings.TrimPrefix(actual, "OAuth "), ", ")
actualKVs := map[string]string{}
@@ -65,7 +65,9 @@ func TestString_CardmarketDemoValues_Success(t *testing.T) {
"oauth_signature": `"mRdSwq4vJcmCByd990zE1NTPWJ0%3D"`,
}
for expectedKey, expectedValue := range expected {
- assert.Equal(t, expectedValue, actualKVs[expectedKey])
+ if expectedValue != actualKVs[expectedKey] {
+ t.Errorf("expected: %q, got: %q", expectedValue, actualKVs[expectedKey])
+ }
}
}
@@ -111,7 +113,9 @@ func TestBuildBaseString(t *testing.T) {
// Assert
expected := `GET&https%3A%2F%2Fapiv2.cardmarket.com%2Fws%2Fv2.0%2Faccount&`
- assert.Equal(t, expected, actual)
+ if expected != actual {
+ t.Errorf("expected: %q, got: %q", expected, actual)
+ }
}
func TestBuildParameterString(t *testing.T) {
@@ -152,7 +156,9 @@ func TestBuildParameterString(t *testing.T) {
// Assert
expected := `oauth_consumer_key%3DbfaD9xOU0SXBhtBP%26oauth_nonce%3D53eb1f44909d6%26oauth_signature_method%3DHMAC-SHA1%26oauth_timestamp%3D1407917892%26oauth_token%3DlBY1xptUJ7ZJSK01x4fNwzw8kAe5b10Q%26oauth_version%3D1.0`
- assert.Equal(t, expected, actual)
+ if expected != actual {
+ t.Errorf("expected: %q, got: %q", expected, actual)
+ }
}
func TestPercentEncode(t *testing.T) {
@@ -180,7 +186,9 @@ func TestPercentEncode(t *testing.T) {
actual := percentEncode(tc.str)
// Assert
- assert.Equal(t, tc.expected, actual)
+ if tc.expected != actual {
+ t.Errorf("expected: %q, got: %q", tc.expected, actual)
+ }
})
}
}