53 lines
1.3 KiB
Python
53 lines
1.3 KiB
Python
# coding: utf-8
|
|
|
|
from __future__ import absolute_import
|
|
import unittest
|
|
|
|
from flask import json
|
|
from six import BytesIO
|
|
|
|
from openapi_server.test import BaseTestCase
|
|
|
|
|
|
class TestDrohneController(BaseTestCase):
|
|
"""DrohneController integration test stubs"""
|
|
|
|
@unittest.skip("image/* not supported by Connexion")
|
|
def test_detect_post(self):
|
|
"""Test case for detect_post
|
|
|
|
|
|
"""
|
|
body = (BytesIO(b'some file data'), 'file.txt')
|
|
headers = {
|
|
'Accept': 'application/json',
|
|
'Content-Type': 'image/*',
|
|
}
|
|
response = self.client.open(
|
|
'/detect',
|
|
method='POST',
|
|
headers=headers,
|
|
data=json.dumps(body),
|
|
content_type='image/*')
|
|
self.assert200(response,
|
|
'Response body is : ' + response.data.decode('utf-8'))
|
|
|
|
def test_image_image_id_get(self):
|
|
"""Test case for image_image_id_get
|
|
|
|
|
|
"""
|
|
headers = {
|
|
'Accept': 'image/*',
|
|
}
|
|
response = self.client.open(
|
|
'/image/<image_id>'.format(image_id='image_id_example'),
|
|
method='GET',
|
|
headers=headers)
|
|
self.assert200(response,
|
|
'Response body is : ' + response.data.decode('utf-8'))
|
|
|
|
|
|
if __name__ == '__main__':
|
|
unittest.main()
|