mirror of
https://github.com/idanoo/autobrr
synced 2025-07-23 08:49:13 +00:00
Add support for using freeleech tokens if available
This commit is contained in:
parent
74f777340e
commit
3656a68a27
28 changed files with 199 additions and 39 deletions
|
@ -86,7 +86,7 @@ func Test_client_GetTorrentByID(t *testing.T) {
|
|||
Url: ts.URL,
|
||||
APIKey: key,
|
||||
},
|
||||
args: args{torrentID: "422368"},
|
||||
args: args{torrentID: "422368", freeleechToken: false},
|
||||
want: &domain.TorrentBasic{
|
||||
Id: "422368",
|
||||
InfoHash: "78DA2811E6732012B8224198D4DC2FD49A5E950F",
|
||||
|
@ -100,7 +100,7 @@ func Test_client_GetTorrentByID(t *testing.T) {
|
|||
Url: ts.URL,
|
||||
APIKey: key,
|
||||
},
|
||||
args: args{torrentID: "100002"},
|
||||
args: args{torrentID: "100002", freeleechToken: true},
|
||||
want: nil,
|
||||
wantErr: false,
|
||||
},
|
||||
|
@ -109,7 +109,7 @@ func Test_client_GetTorrentByID(t *testing.T) {
|
|||
t.Run(tt.name, func(t *testing.T) {
|
||||
c := NewClient(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) {
|
||||
t.Logf("got err: %v", err)
|
||||
assert.Equal(t, tt.wantErr, err)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue