1
0
mirror of https://github.com/gsi-upm/senpy synced 2025-09-18 20:42:22 +00:00
This commit is contained in:
J. Fernando Sánchez
2018-10-30 15:15:37 +01:00
parent 6dd4a44924
commit c939b095de
5 changed files with 42 additions and 10 deletions

View File

@@ -24,6 +24,19 @@ class ModelsTest(TestCase):
except Error:
pass
def test_client_post(self):
endpoint = 'http://dummy/'
client = Client(endpoint)
with patch_requests('http://dummy/', Results()):
resp = client.analyse('hello')
assert isinstance(resp, Results)
with patch_requests('http://dummy/', Error('Nothing'), method='POST'):
try:
client.analyse(input='hello', method='POST', algorithm='NONEXISTENT')
raise Exception('Exceptions should be raised. This is not golang')
except Error:
pass
def test_plugins(self):
endpoint = 'http://dummy/'
client = Client(endpoint)