aboutsummaryrefslogtreecommitdiff
path: root/pkg/ext/auth_test.go
diff options
context:
space:
mode:
Diffstat (limited to 'pkg/ext/auth_test.go')
-rw-r--r--pkg/ext/auth_test.go40
1 files changed, 0 insertions, 40 deletions
diff --git a/pkg/ext/auth_test.go b/pkg/ext/auth_test.go
deleted file mode 100644
index dc72a0c..0000000
--- a/pkg/ext/auth_test.go
+++ /dev/null
@@ -1,40 +0,0 @@
-//go:build unit
-
-package ext
-
-import (
- "testing"
-
- "git.sr.ht/~gabrielgio/img/pkg/testkit"
-)
-
-func TestReadWriteToken(t *testing.T) {
- t.Parallel()
-
- testCases := []struct {
- name string
- key []byte
- token *Token
- }{
- {
- name: "Normal write",
- key: []byte("AES256Key-32Characters1234567890"),
- token: &Token{
- UserID: 3,
- Username: "username",
- },
- },
- }
-
- for _, tc := range testCases {
- t.Run(tc.name, func(t *testing.T) {
- data, err := WriteToken(tc.token, tc.key)
- testkit.TestFatalError(t, "WriteToken", err)
-
- token, err := ReadToken(data, tc.key)
- testkit.TestFatalError(t, "ReadToken", err)
-
- testkit.TestValue(t, "ReadWriteToken", token, tc.token)
- })
- }
-}