diff --git a/cmd/tests.sh b/cmd/tests.sh index a1c105f..1fa264a 100755 --- a/cmd/tests.sh +++ b/cmd/tests.sh @@ -238,6 +238,16 @@ test $(($rts_count + $tweet_count_2 - $tweet_count_1)) -gt "50" tw fetch_user LandsharkRides test $(sqlite3 twitter.db "select is_private from users where handle = 'LandsharkRides'") = "1" + +# Fetch a user who deleted and made a new account with the same handle +sqlite3 twitter.db "INSERT INTO users(rowid,id,display_name,handle,bio,following_count,followers_count,location,website,join_date,is_private,is_verified,is_banned,profile_image_url,profile_image_local_path,banner_image_url,banner_image_local_path,pinned_tweet_id,is_content_downloaded,is_followed,is_id_fake,is_deleted) VALUES(134934,1615394007961731072,'Monsieur Chat ✊🏼','9MonsieurChat9','Lives: 4 (-5)',121,694,'','',1673974925000,0,0,0,'https://pbs.twimg.com/profile_images/1818708927842074627/O0i9kUeI.jpg','9MonsieurChat9_profile_O0i9kUeI.jpg','','',1834121200584589600,0,0,0,0)" +test $(sqlite3 twitter.db "select count(*) from users where handle like '9MonsieurChat9'") = "1" +tw fetch_user 9MonsieurChat9 # Should get the updated one +test $(sqlite3 twitter.db "select count(*) from users where handle like '9MonsieurChat9'") = "2" +test $(sqlite3 twitter.db "select count(*) from users where handle like '9MonsieurChat9' and not is_deleted") = "1" +test $(sqlite3 twitter.db "select is_deleted from users where id = 1615394007961731072") = "1" + + # Test tweets with URLs tw fetch_user RoninGreg urls_count=$(sqlite3 twitter.db "select count(*) from urls") @@ -325,7 +335,7 @@ test $(sqlite3 twitter.db "select is_stub, user_id = 0x4000000000000000 from twe # Test fetching a banned user tw fetch_user nancytracker -test "$(sqlite3 twitter.db "select is_content_downloaded, is_banned from users where handle='nancytracker'")" = "1|1" +test "$(sqlite3 twitter.db "select is_banned from users where handle='nancytracker'")" = "1" # Fetch a user with "600x200" banner image