80 lines
2.1 KiB
Python
80 lines
2.1 KiB
Python
|
# coding: utf-8
|
||
|
|
||
|
from __future__ import absolute_import
|
||
|
|
||
|
from flask import json
|
||
|
from six import BytesIO
|
||
|
|
||
|
from swagger_server.models.medal import Medal # noqa: E501
|
||
|
from swagger_server.test import BaseTestCase
|
||
|
|
||
|
|
||
|
class TestMedalController(BaseTestCase):
|
||
|
"""MedalController integration test stubs"""
|
||
|
|
||
|
def test_medal_get(self):
|
||
|
"""Test case for medal_get
|
||
|
|
||
|
Display medals list
|
||
|
"""
|
||
|
response = self.client.open(
|
||
|
'//medal',
|
||
|
method='GET')
|
||
|
self.assert200(response,
|
||
|
'Response body is : ' + response.data.decode('utf-8'))
|
||
|
|
||
|
def test_medal_id_delete(self):
|
||
|
"""Test case for medal_id_delete
|
||
|
|
||
|
Delete medal from Id
|
||
|
"""
|
||
|
response = self.client.open(
|
||
|
'//medal/{id}'.format(id=56),
|
||
|
method='DELETE')
|
||
|
self.assert200(response,
|
||
|
'Response body is : ' + response.data.decode('utf-8'))
|
||
|
|
||
|
def test_medal_id_get(self):
|
||
|
"""Test case for medal_id_get
|
||
|
|
||
|
Display a medal
|
||
|
"""
|
||
|
response = self.client.open(
|
||
|
'//medal/{id}'.format(id=56),
|
||
|
method='GET')
|
||
|
self.assert200(response,
|
||
|
'Response body is : ' + response.data.decode('utf-8'))
|
||
|
|
||
|
def test_medal_id_patch(self):
|
||
|
"""Test case for medal_id_patch
|
||
|
|
||
|
Modify element from medal
|
||
|
"""
|
||
|
body = Medal()
|
||
|
response = self.client.open(
|
||
|
'//medal/{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_medal_post(self):
|
||
|
"""Test case for medal_post
|
||
|
|
||
|
Add a new medal
|
||
|
"""
|
||
|
body = Medal()
|
||
|
response = self.client.open(
|
||
|
'//medal',
|
||
|
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()
|