Improve logout
drop session in Twitter
This commit is contained in:
parent
e86c2fa4ce
commit
90f9a71721
3 changed files with 28 additions and 14 deletions
10
auth_test.go
10
auth_test.go
|
|
@ -22,13 +22,15 @@ func TestAuth(t *testing.T) {
|
|||
t.Fatalf("Expected IsLoggedIn() = true")
|
||||
}
|
||||
cookies := scraper.GetCookies()
|
||||
scraper.Logout()
|
||||
if scraper.IsLoggedIn() {
|
||||
t.Error("Expected IsLoggedIn() = false")
|
||||
}
|
||||
scraper2 := twitterscraper.New()
|
||||
scraper2.SetCookies(cookies)
|
||||
if !scraper2.IsLoggedIn() {
|
||||
t.Error("Expected restored IsLoggedIn() = true")
|
||||
}
|
||||
if err := scraper.Logout(); err != nil {
|
||||
t.Errorf("Logout() error = %v", err)
|
||||
}
|
||||
if scraper.IsLoggedIn() {
|
||||
t.Error("Expected IsLoggedIn() = false")
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue