1
0
mirror of https://github.com/gsi-upm/senpy synced 2025-08-23 18:12:20 +00:00

Improved docs and client

* Client now raises an exception on error
* Added conversion to the documentation
This commit is contained in:
J. Fernando Sánchez
2017-02-28 19:38:01 +01:00
parent 97bd245dfc
commit a0ff528a4b
6 changed files with 186 additions and 78 deletions

View File

@@ -34,8 +34,11 @@ class ModelsTest(TestCase):
url=endpoint + '/', method='GET', params={'input': 'hello'})
error = Call(Error('Nothing'))
with patch('requests.request', return_value=error) as patched:
resp = client.analyse(input='hello', algorithm='NONEXISTENT')
assert isinstance(resp, Error)
try:
client.analyse(input='hello', algorithm='NONEXISTENT')
raise Exception('Exceptions should be raised. This is not golang')
except Error:
pass
patched.assert_called_with(
url=endpoint + '/',
method='GET',