Skip to content

Commit 0eb4d0b

Browse files
committed
✅ Pass service test and optimize imports
1 parent c9e1fc6 commit 0eb4d0b

File tree

6 files changed

+8
-15
lines changed

6 files changed

+8
-15
lines changed

pkg/auth/service_test.go

Lines changed: 8 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -40,26 +40,22 @@ func TestNewY2BService(t *testing.T) {
4040
want: &svc{
4141
Credential: credential,
4242
CacheToken: cacheToken,
43-
Cacheable: false,
43+
credFile: "client_secret.json",
4444
ctx: context.Background(),
4545
},
4646
},
4747
{
4848
name: "with all options - base64",
4949
args: args{
5050
opts: []Option{
51-
WithCredential(
52-
"eyJjbGllbnRfaWQiOiJ0ZXN0In0=", mockFS,
53-
),
54-
WithCacheToken(
55-
"eyJhY2Nlc3NfdG9rZW4iOiJ0ZXN0In0=", mockFS,
56-
),
51+
WithCredential("eyJjbGllbnRfaWQiOiJ0ZXN0In0=", mockFS),
52+
WithCacheToken("eyJhY2Nlc3NfdG9rZW4iOiJ0ZXN0In0=", mockFS),
5753
},
5854
},
5955
want: &svc{
6056
Credential: credential,
6157
CacheToken: cacheToken,
62-
Cacheable: false,
58+
credFile: "client_secret.json",
6359
ctx: context.Background(),
6460
},
6561
},
@@ -74,7 +70,8 @@ func TestNewY2BService(t *testing.T) {
7470
want: &svc{
7571
Credential: credential,
7672
CacheToken: cacheToken,
77-
Cacheable: true,
73+
credFile: "/client_secrets.json",
74+
tokenFile: "/youtube.token.json",
7875
ctx: context.Background(),
7976
},
8077
},
@@ -84,7 +81,8 @@ func TestNewY2BService(t *testing.T) {
8481
opts: []Option{},
8582
},
8683
want: &svc{
87-
ctx: context.Background(),
84+
credFile: "client_secret.json",
85+
ctx: context.Background(),
8886
},
8987
},
9088
}

pkg/channelBanner/channelBanner.go

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@ import (
44
"errors"
55
"fmt"
66
"io"
7-
"os"
87

98
"github.com/eat-pray-ai/yutu/pkg"
109
"github.com/eat-pray-ai/yutu/pkg/auth"

pkg/playlistImage/playlistImage.go

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@ import (
44
"errors"
55
"fmt"
66
"io"
7-
"os"
87

98
"github.com/eat-pray-ai/yutu/pkg"
109
"github.com/eat-pray-ai/yutu/pkg/auth"

pkg/thumbnail/thumbnail.go

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@ import (
44
"errors"
55
"fmt"
66
"io"
7-
"os"
87

98
"github.com/eat-pray-ai/yutu/pkg"
109
"github.com/eat-pray-ai/yutu/pkg/auth"

pkg/video/video.go

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@ import (
44
"errors"
55
"fmt"
66
"io"
7-
"os"
87
"slices"
98

109
"github.com/eat-pray-ai/yutu/pkg"

pkg/watermark/watermark.go

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@ import (
44
"errors"
55
"fmt"
66
"io"
7-
"os"
87

98
"github.com/eat-pray-ai/yutu/pkg"
109
"github.com/eat-pray-ai/yutu/pkg/auth"

0 commit comments

Comments
 (0)