Mercurial > public > tweet-analysis
comparison tests/unit/test_url_controller.py @ 8:6541622b6127
add tweet analysis method
author | Dennis Concepcion Martin <dennisconcepcionmartin@gmail.com> |
---|---|
date | Fri, 17 Sep 2021 21:10:02 +0200 |
parents | |
children |
comparison
equal
deleted
inserted
replaced
7:1b1296559c31 | 8:6541622b6127 |
---|---|
1 from unittest import TestCase | |
2 from dependencies.python.url_controller import TwitterApi | |
3 | |
4 | |
5 class TestTwitterApi(TestCase): | |
6 def test_create_twitter_url(self): | |
7 twitter_user = 'Twitter' | |
8 number_of_tweets = '50' | |
9 url = TwitterApi.create_sentiment_url(twitter_user, number_of_tweets) | |
10 expected_url = 'https://api.twitter.com/2/tweets/search/recent?max_results={}&query=from:{}'.format( | |
11 number_of_tweets, twitter_user | |
12 ) | |
13 | |
14 self.assertEqual(url, expected_url) |