Fix integration tests

This commit is contained in:
Alessio 2023-11-12 13:35:32 -08:00
parent 99f6de9d45
commit 0b4ed73605

View File

@ -204,10 +204,11 @@ test $(sqlite3 twitter.db "select is_content_downloaded from users where handle=
# Get a user's feed # Get a user's feed
malice_id=$(sqlite3 twitter.db "select id from users where handle='michaelmalice'") tw fetch_user covfefeanon
covfefe_id=$(sqlite3 twitter.db "select id from users where handle like 'covfefeanon'")
test $(sqlite3 twitter.db "select count(*) from retweets") = "0" test $(sqlite3 twitter.db "select count(*) from retweets") = "0"
tweet_count_1=$(sqlite3 twitter.db "select count(*) from tweets") tweet_count_1=$(sqlite3 twitter.db "select count(*) from tweets")
tw get_user_tweets michaelmalice tw get_user_tweets covfefeanon
# Check that there are some retweets # Check that there are some retweets
rts_count=$(sqlite3 twitter.db "select count(*) from retweets") rts_count=$(sqlite3 twitter.db "select count(*) from retweets")
@ -215,7 +216,7 @@ test $rts_count -gt "0"
# Check that new retweets plus new tweets > 50 # Check that new retweets plus new tweets > 50
tweet_count_2=$(sqlite3 twitter.db "select count(*) from tweets") tweet_count_2=$(sqlite3 twitter.db "select count(*) from tweets")
test $(sqlite3 twitter.db "select count(*) from retweets where retweeted_by != $malice_id") = "0" test $(sqlite3 twitter.db "select count(*) from retweets where retweeted_by != $covfefe_id") = "0"
test $(($rts_count + $tweet_count_2 - $tweet_count_1)) -gt "50" test $(($rts_count + $tweet_count_2 - $tweet_count_1)) -gt "50"