Skip to content

Commit e74865b

Browse files
committed
Fixes #101: Improve user method tests.
This commit add tests for: - Getting user with specific no of followers and following by passing no of followers and following as a query params. - Passing null argument to method, which should return proper error message.
1 parent 0206185 commit e74865b

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

tests/test.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -100,10 +100,15 @@ def test_push(self):
100100
def test_user(self):
101101
"""Test user."""
102102
result = self.loklak.user('dhruvRamani98')
103-
self.assertTrue('error' in self.loklak.user())
104103
self.assertTrue('user' in result)
105104
self.assertTrue('name' in result['user'])
106105
self.assertTrue('screen_name' in result['user'])
106+
result = self.loklak.user("fossasia", 1500, 330)
107+
self.assertTrue('user' in result)
108+
self.assertTrue('name' in result['user'])
109+
result = self.loklak.user()
110+
self.assertTrue('error' in self.loklak.user())
111+
self.assertEqual(result, '{"error": "No user name given to query. Please check and try again"}')
107112

108113
def test_search(self):
109114
"""Test search result."""

0 commit comments

Comments
 (0)