fix tests
This commit is contained in:
parent
6a5df36aed
commit
cc633cb1ea
6 changed files with 214 additions and 138 deletions
15
api_test.go
15
api_test.go
|
|
@ -2,12 +2,11 @@ package twitterscraper_test
|
|||
|
||||
import (
|
||||
"testing"
|
||||
|
||||
twitterscraper "github.com/imperatrona/twitter-scraper"
|
||||
)
|
||||
|
||||
func TestGetGuestToken(t *testing.T) {
|
||||
scraper := twitterscraper.New()
|
||||
scraper := newTestScraper(true)
|
||||
|
||||
if err := scraper.GetGuestToken(); err != nil {
|
||||
t.Errorf("getGuestToken() error = %v", err)
|
||||
}
|
||||
|
|
@ -15,3 +14,13 @@ func TestGetGuestToken(t *testing.T) {
|
|||
t.Error("Expected non-empty guestToken")
|
||||
}
|
||||
}
|
||||
|
||||
func TestClearGuestToken(t *testing.T) {
|
||||
scraper := newTestScraper(false)
|
||||
|
||||
scraper.ClearGuestToken()
|
||||
|
||||
if scraper.IsGuestToken() {
|
||||
t.Error("Expected empty guestToken")
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue