80 lines
2.2 KiB
Python
80 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.sport import Sport # noqa: E501
|
||
|
from swagger_server.test import BaseTestCase
|
||
|
|
||
|
|
||
|
class TestSportsController(BaseTestCase):
|
||
|
"""SportsController integration test stubs"""
|
||
|
|
||
|
def test_sport_get(self):
|
||
|
"""Test case for sport_get
|
||
|
|
||
|
List all available sports
|
||
|
"""
|
||
|
response = self.client.open(
|
||
|
'//sport',
|
||
|
method='GET')
|
||
|
self.assert200(response,
|
||
|
'Response body is : ' + response.data.decode('utf-8'))
|
||
|
|
||
|
def test_sport_id_delete(self):
|
||
|
"""Test case for sport_id_delete
|
||
|
|
||
|
Delete a specific sport using the ID
|
||
|
"""
|
||
|
response = self.client.open(
|
||
|
'//sport/{id}'.format(id=56),
|
||
|
method='DELETE')
|
||
|
self.assert200(response,
|
||
|
'Response body is : ' + response.data.decode('utf-8'))
|
||
|
|
||
|
def test_sport_id_get(self):
|
||
|
"""Test case for sport_id_get
|
||
|
|
||
|
Display a specific sport using the ID
|
||
|
"""
|
||
|
response = self.client.open(
|
||
|
'//sport/{id}'.format(id=56),
|
||
|
method='GET')
|
||
|
self.assert200(response,
|
||
|
'Response body is : ' + response.data.decode('utf-8'))
|
||
|
|
||
|
def test_sport_id_patch(self):
|
||
|
"""Test case for sport_id_patch
|
||
|
|
||
|
Edit a specific sport using the ID
|
||
|
"""
|
||
|
body = Sport()
|
||
|
response = self.client.open(
|
||
|
'//sport/{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_sport_post(self):
|
||
|
"""Test case for sport_post
|
||
|
|
||
|
Add a sport
|
||
|
"""
|
||
|
body = Sport()
|
||
|
response = self.client.open(
|
||
|
'//sport',
|
||
|
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()
|