offline-twitter/scraper/authentication_test.go

29 lines
506 B
Go
Raw Normal View History

2022-12-10 14:33:27 -05:00
package scraper_test
import (
2022-12-22 23:12:11 -05:00
"fmt"
2022-12-10 14:33:27 -05:00
"offline_twitter/scraper"
"testing"
2022-12-20 19:05:08 -05:00
"github.com/stretchr/testify/assert"
2022-12-10 14:33:27 -05:00
)
func TestAuthentication(t *testing.T) {
2022-12-20 19:05:08 -05:00
assert := assert.New(t)
2022-12-10 14:33:27 -05:00
username := "offline_twatter"
password := "S1pKIW#eRT016iA@OFcK"
api := scraper.NewGuestSession()
api.LogIn(username, password)
2022-12-20 19:05:08 -05:00
assert.True(api.IsAuthenticated)
assert.NotEqual(api.CSRFToken, "")
2022-12-22 23:12:11 -05:00
response, err := api.GetLikesFor(1458284524761075714, "")
if err != nil {
panic(err)
}
fmt.Println(response)
2022-12-10 14:33:27 -05:00
}