mirror of
https://github.com/idanoo/autobrr
synced 2025-07-23 00:39:13 +00:00
Add support for using freeleech tokens if available
This commit is contained in:
parent
74f777340e
commit
1242c19883
21 changed files with 88 additions and 34 deletions
|
@ -72,7 +72,7 @@ func TestPTPClient_GetTorrentByID(t *testing.T) {
|
|||
APIUser: user,
|
||||
APIKey: key,
|
||||
},
|
||||
args: args{torrentID: "1"},
|
||||
args: args{torrentID: "1", freeleechToken: false},
|
||||
want: &domain.TorrentBasic{
|
||||
Id: "1",
|
||||
InfoHash: "F57AA86DFB03F87FCC7636E310D35918442EAE5C",
|
||||
|
@ -87,7 +87,7 @@ func TestPTPClient_GetTorrentByID(t *testing.T) {
|
|||
APIUser: user,
|
||||
APIKey: key,
|
||||
},
|
||||
args: args{torrentID: "100002"},
|
||||
args: args{torrentID: "100002", freeleechToken: false},
|
||||
want: nil,
|
||||
wantErr: true,
|
||||
},
|
||||
|
@ -96,7 +96,7 @@ func TestPTPClient_GetTorrentByID(t *testing.T) {
|
|||
t.Run(tt.name, func(t *testing.T) {
|
||||
c := NewClient(tt.fields.APIUser, tt.fields.APIKey, WithUrl(ts.URL))
|
||||
|
||||
got, err := c.GetTorrentByID(context.Background(), tt.args.torrentID)
|
||||
got, err := c.GetTorrentByID(context.Background(), tt.args.torrentID, tt.args.freeleechToken)
|
||||
if tt.wantErr {
|
||||
assert.Error(t, err)
|
||||
} else {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue