Skip to content

Commit

Permalink
added assertion tests
Browse files Browse the repository at this point in the history
  • Loading branch information
Jeroen van der Heijden committed Oct 26, 2016
1 parent 05a7f6a commit 8caf41c
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 0 deletions.
4 changes: 4 additions & 0 deletions ChangeLog
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
2016.x.x, Version 2.x.x (BETA)

- Check for correct types using assert in query method.

2016.10.26, Version 2.0.3 (BETA)

- Replaced logging failed ping to prevent unhandled error msg. (issue #2)
Expand Down
6 changes: 6 additions & 0 deletions siridb/twisted/lib/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -162,6 +162,12 @@ def query(self, query, timePrecision=None, timeout=60):
see module doc-string for info on exception handling.
'''
assert isinstance(query, (str, unicode, bytes)), \
'query should be of type str, unicode or bytes'

assert timePrecision is None or isinstance(timePrecision, int), \
'timePrecision should be None or an int type.'

tryUnavailable = True
while True:
factory = self._getRandomConnection(tryUnavailable)
Expand Down

0 comments on commit 8caf41c

Please sign in to comment.