Skip to content

Commit

Permalink
Fixes #103: Improve search method tests.
Browse files Browse the repository at this point in the history
Add tests for:
- Getting result in specific time interval by passing
  date/hour argument to method.
- Passing no query arguments for method which should
  return error with proper warning.

Modified files:
	modified:   tests/test.py
  • Loading branch information
YJDave committed Jan 30, 2018
1 parent fd565a6 commit da7dd2a
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions tests/test.py
Original file line number Diff line number Diff line change
Expand Up @@ -120,6 +120,12 @@ def test_search(self):
int(result['search_metadata']['maximumRecords']))
self.assertEqual(int(result['search_metadata']['maximumRecords']), 18)

result = self.loklak.search('FOSSASIA', since='2000-01-01', until='2017-12-31_12:24', from_user='fossasia', count=20)
self.assertTrue('statuses' in result)

result = self.loklak.search()
self.assertEqual(result, '{"error": "No Query string has been given to query for an account"}')

def test_aggregations(self):
"""Test aggregations."""
result = self.loklak.aggregations('fossasia', '2017-01-10',
Expand Down

0 comments on commit da7dd2a

Please sign in to comment.