Skip to content

Commit 7a611d1

Browse files
committed
Fixes #103: Improve search method tests.
Add tests for: - Getting result in specific time interval by passing date/hour argument to method. - Passing null query arguments for method which should return error with proper warning.
1 parent 9f75d1a commit 7a611d1

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

tests/test.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -120,6 +120,12 @@ def test_search(self):
120120
int(result['search_metadata']['maximumRecords']))
121121
self.assertEqual(int(result['search_metadata']['maximumRecords']), 18)
122122

123+
result = self.loklak.search('FOSSASIA', since='2000-01-01', until='2017-12-31_12:24', from_user='fossasia', count=20)
124+
self.assertTrue('statuses' in result)
125+
126+
result = self.loklak.search()
127+
self.assertEqual(result, '{"error": "No Query string has been given to query for an account"}')
128+
123129
def test_aggregations(self):
124130
"""Test aggregations."""
125131
result = self.loklak.aggregations('fossasia', '2017-01-10',

0 commit comments

Comments
 (0)