API_Microservices/swagger/swagger_server/test/test_athletes_controller.py
2024-03-27 17:07:47 +01:00

79 lines
2.2 KiB
Python

# coding: utf-8
from __future__ import absolute_import
from flask import json
from six import BytesIO
from swagger_server.models.athlete import Athlete # noqa: E501
from swagger_server.test import BaseTestCase
class TestAthletesController(BaseTestCase):
"""AthletesController integration test stubs"""
def test_athlete_get(self):
"""Test case for athlete_get
Display athletes list
"""
response = self.client.open(
'//athlete',
method='GET')
self.assert200(response,
'Response body is : ' + response.data.decode('utf-8'))
def test_athlete_id_delete(self):
"""Test case for athlete_id_delete
Delete an athlete using the ID
"""
response = self.client.open(
'//athlete/{id}'.format(id=56),
method='DELETE')
self.assert200(response,
'Response body is : ' + response.data.decode('utf-8'))
def test_athlete_id_get(self):
"""Test case for athlete_id_get
Display one athlete using the ID
"""
response = self.client.open(
'//athlete/{id}'.format(id=56),
method='GET')
self.assert200(response,
'Response body is : ' + response.data.decode('utf-8'))
def test_athlete_id_patch(self):
"""Test case for athlete_id_patch
Modify a athlete using the ID
"""
body = Athlete()
response = self.client.open(
'//athlete/{id}'.format(id=56),
method='PATCH',
data=json.dumps(body),
content_type='application/json')
self.assert200(response,
'Response body is : ' + response.data.decode('utf-8'))
def test_athlete_post(self):
"""Test case for athlete_post
Add a new athlete
"""
body = Athlete()
response = self.client.open(
'//athlete',
method='POST',
data=json.dumps(body),
content_type='application/json')
self.assert200(response,
'Response body is : ' + response.data.decode('utf-8'))
if __name__ == '__main__':
import unittest
unittest.main()