diff 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
line wrap: on
line diff
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/tests/unit/test_url_controller.py	Fri Sep 17 21:10:02 2021 +0200
@@ -0,0 +1,14 @@
+from unittest import TestCase
+from dependencies.python.url_controller import TwitterApi
+
+
+class TestTwitterApi(TestCase):
+    def test_create_twitter_url(self):
+        twitter_user = 'Twitter'
+        number_of_tweets = '50'
+        url = TwitterApi.create_sentiment_url(twitter_user, number_of_tweets)
+        expected_url = 'https://api.twitter.com/2/tweets/search/recent?max_results={}&query=from:{}'.format(
+            number_of_tweets, twitter_user
+        )
+
+        self.assertEqual(url, expected_url)