tvdb - conn_test.go
1 package tvdb_test
2
3 import (
4 "testing"
5
6 "vimagination.zapto.org/tvdb"
7 )
8
9 func TestLogin(t *testing.T) {
10 _, err := tvdb.Login(tvdb.Auth{})
11 if err != tvdb.ErrInvalidAuth {
12 t.Errorf("expecting invalid auth, got %s", err)
13 }
14 c, err := tvdb.Login(auth)
15 if err != nil {
16 t.Fatalf("unexpected error: %s", err)
17 }
18 conn = c
19 }
20
21 func TestRefresh(t *testing.T) {
22 t.Parallel()
23 if err := conn.Refresh(); err != nil {
24 t.Errorf("unexpected refresh error: %s", err)
25 }
26 }