init commit

This commit is contained in:
2025-02-13 11:29:07 +01:00
commit dd619df7a2
78 changed files with 5266 additions and 0 deletions
+16
View File
@@ -0,0 +1,16 @@
import logging
import connexion
from flask_testing import TestCase
from openapi_server.encoder import JSONEncoder
class BaseTestCase(TestCase):
def create_app(self):
logging.getLogger('connexion.operation').setLevel('ERROR')
app = connexion.App(__name__, specification_dir='../openapi/')
app.app.json_encoder = JSONEncoder
app.add_api('openapi.yaml', pythonic_params=True)
return app.app
@@ -0,0 +1,62 @@
import unittest
from flask import json
from openapi_server.models.patch_notes import PatchNotes # noqa: E501
from openapi_server.test import BaseTestCase
class TestDefaultController(BaseTestCase):
"""DefaultController integration test stubs"""
def test_get_patchnotes(self):
"""Test case for get_patchnotes
"""
headers = {
'Accept': 'application/json',
}
response = self.client.open(
'/patchnotes',
method='GET',
headers=headers)
self.assert200(response,
'Response body is : ' + response.data.decode('utf-8'))
def test_patch_note_delete(self):
"""Test case for patch_note_delete
"""
headers = {
}
response = self.client.open(
'/patchnotes/{patch_id}'.format(patch_id='patch_id_example'),
method='DELETE',
headers=headers)
self.assert200(response,
'Response body is : ' + response.data.decode('utf-8'))
def test_post_patchnotes(self):
"""Test case for post_patchnotes
"""
patch_notes = openapi_server.PatchNotes()
headers = {
'Accept': 'application/json',
'Content-Type': 'application/json',
}
response = self.client.open(
'/patchnotes',
method='POST',
headers=headers,
data=json.dumps(patch_notes),
content_type='application/json')
self.assert200(response,
'Response body is : ' + response.data.decode('utf-8'))
if __name__ == '__main__':
unittest.main()
@@ -0,0 +1,63 @@
import unittest
from flask import json
import openapi_server
from openapi_server.models.patch_notes import PatchNotes # noqa: E501
from openapi_server.test import BaseTestCase
class TestPatchnotesController(BaseTestCase):
"""PatchnotesController integration test stubs"""
def test_get_patchnotes(self):
"""Test case for get_patchnotes
"""
headers = {
'Accept': 'application/json',
}
response = self.client.open(
'/patchnotes',
method='GET',
headers=headers)
self.assert200(response,
'Response body is : ' + response.data.decode('utf-8'))
def test_patch_note_delete(self):
"""Test case for patch_note_delete
"""
headers = {
}
response = self.client.open(
'/patchnotes/{patch_id}'.format(patch_id='patch_id_example'),
method='DELETE',
headers=headers)
self.assert200(response,
'Response body is : ' + response.data.decode('utf-8'))
def test_post_patchnotes(self):
"""Test case for post_patchnotes
"""
patch_notes = openapi_server.PatchNotes()
headers = {
'Accept': 'application/json',
'Content-Type': 'application/json',
}
response = self.client.open(
'/patchnotes',
method='POST',
headers=headers,
data=json.dumps(patch_notes),
content_type='application/json')
self.assert200(response,
'Response body is : ' + response.data.decode('utf-8'))
if __name__ == '__main__':
unittest.main()