Fix profile tests

This commit is contained in:
Alexander Sheiko 2021-01-28 10:54:43 +02:00
parent ec34ab7422
commit a4375c3b2d

View file

@ -12,8 +12,8 @@ func TestGetProfile(t *testing.T) {
loc := time.FixedZone("UTC", 0) loc := time.FixedZone("UTC", 0)
joined := time.Date(2007, 02, 20, 14, 35, 54, 0, loc) joined := time.Date(2007, 02, 20, 14, 35, 54, 0, loc)
sample := Profile{ sample := Profile{
Avatar: "https://pbs.twimg.com/profile_images/1308010958862905345/-SGZioPb_normal.jpg", Avatar: "https://pbs.twimg.com/profile_images/1354479643882004483/Btnfm47p_normal.jpg",
Banner: "https://pbs.twimg.com/profile_banners/783214/1609475315", Banner: "https://pbs.twimg.com/profile_banners/783214/1611770459",
Biography: "What's happening?!", Biography: "What's happening?!",
// Birthday: "March 21", // Birthday: "March 21",
IsPrivate: false, IsPrivate: false,
@ -61,26 +61,26 @@ func TestGetProfile(t *testing.T) {
func TestGetProfilePrivate(t *testing.T) { func TestGetProfilePrivate(t *testing.T) {
loc := time.FixedZone("UTC", 0) loc := time.FixedZone("UTC", 0)
joined := time.Date(2009, 8, 12, 6, 18, 29, 0, loc) joined := time.Date(2020, 1, 26, 0, 3, 5, 0, loc)
sample := Profile{ sample := Profile{
Avatar: "https://pbs.twimg.com/profile_images/1352282054256324610/_v3nslbW_normal.jpg", Avatar: "https://pbs.twimg.com/profile_images/1222218816484020224/ik9P1QZt_normal.jpg",
Banner: "https://pbs.twimg.com/profile_banners/64958707/1551520603", Banner: "",
Biography: "", Biography: "private account",
// Birthday: "March 21", // Birthday: "March 21",
IsPrivate: true, IsPrivate: true,
IsVerified: false, IsVerified: false,
Joined: &joined, Joined: &joined,
Location: "", Location: "",
Name: "saidah.jpg", Name: "private account",
PinnedTweetIDs: []string{}, PinnedTweetIDs: []string{},
URL: "https://twitter.com/sdhftrh", URL: "https://twitter.com/tomdumont",
UserID: "64958707", UserID: "1221221876849995777",
Username: "sdhftrh", Username: "tomdumont",
Website: "https://youtu.be/0liuo2Q4bGo", Website: "",
} }
// some random private profile (found via google) // some random private profile (found via google)
profile, err := GetProfile("sdhftrh") profile, err := GetProfile("tomdumont")
if err != nil { if err != nil {
t.Error(err) t.Error(err)
} }
@ -97,9 +97,6 @@ func TestGetProfilePrivate(t *testing.T) {
t.Error("Resulting profile does not match the sample", diff) t.Error("Resulting profile does not match the sample", diff)
} }
if profile.FollowersCount == 0 {
t.Error("Expected FollowersCount is greater than zero")
}
if profile.FollowingCount == 0 { if profile.FollowingCount == 0 {
t.Error("Expected FollowingCount is greater than zero") t.Error("Expected FollowingCount is greater than zero")
} }