Skip to content

Commit a6037a4

Browse files
committed
✅ Remedy tests for ids
1 parent b909ab5 commit a6037a4

File tree

4 files changed

+7
-7
lines changed

4 files changed

+7
-7
lines changed

pkg/caption/caption.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ type caption struct {
4040
}
4141

4242
type Caption interface {
43-
get(parts []string) []*youtube.Caption
43+
get(parts []string) []*youtube.Caption // todo: return error
4444
List(parts []string, output string)
4545
Insert(output string)
4646
Update(output string)

pkg/channel/channel_test.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ func TestNewChannel(t *testing.T) {
2323
WithForHandle("handle"),
2424
WithForUsername("username"),
2525
WithHl("hl"),
26-
WithID("id"),
26+
WithIDs([]string{"id1", "id2"}),
2727
WithChannelManagedByMe(utils.BoolPtr("true")),
2828
WithMaxResults(5),
2929
WithMine(utils.BoolPtr("false")),
@@ -36,7 +36,7 @@ func TestNewChannel(t *testing.T) {
3636
ForHandle: "handle",
3737
ForUsername: "username",
3838
Hl: "hl",
39-
ID: "id",
39+
IDs: []string{"id1", "id2"},
4040
ManagedByMe: utils.BoolPtr("true"),
4141
MaxResults: 5,
4242
Mine: utils.BoolPtr("false"),

pkg/utils/utils.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,15 +16,15 @@ import (
1616
)
1717

1818
func PrintJSON(data interface{}, writer io.Writer) {
19-
if writer == nil {
19+
if writer == nil { // todo: remove fallback to stdout
2020
writer = os.Stdout
2121
}
2222
marshalled, _ := json.MarshalIndent(data, "", " ")
2323
_, _ = fmt.Fprintln(writer, string(marshalled))
2424
}
2525

2626
func PrintYAML(data interface{}, writer io.Writer) {
27-
if writer == nil {
27+
if writer == nil { // todo: remove fallback to stdout
2828
writer = os.Stdout
2929
}
3030
marshalled, _ := yaml.Marshal(data)

pkg/video/video_test.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ func TestNewVideo(t *testing.T) {
1919
name: "TestNewVideo",
2020
args: args{
2121
opts: []Option{
22-
WithID("id"),
22+
WithIDs([]string{"id1", "id2"}),
2323
WithAutoLevels(utils.BoolPtr("true")),
2424
WithFile("file"),
2525
WithTitle("title"),
@@ -32,7 +32,7 @@ func TestNewVideo(t *testing.T) {
3232
},
3333
},
3434
want: &video{
35-
ID: "id",
35+
IDs: []string{"id1", "id2"},
3636
AutoLevels: utils.BoolPtr("true"),
3737
File: "file",
3838
Title: "title",

0 commit comments

Comments
 (0)