mirror of
https://github.com/OpenAPITools/openapi-generator.git
synced 2025-05-14 05:30:51 +00:00
* Process inline examples (if available) * Test generation with inline examples * Update samples * Move test to CI testing suite
35 lines
880 B
Python
35 lines
880 B
Python
"""
|
|
Testing Postman generator output
|
|
"""
|
|
from __future__ import absolute_import
|
|
|
|
import unittest
|
|
|
|
import json
|
|
|
|
|
|
class TestParameters(unittest.TestCase):
|
|
|
|
def setUp(self):
|
|
with open('./postman.json', 'r') as file:
|
|
self.json_data = json.load(file)
|
|
|
|
def tearDown(self):
|
|
pass
|
|
|
|
def test_endpoint_deprecated(self):
|
|
# path
|
|
path = self.json_data['item'][0]['item'][0]
|
|
self.assertEqual(path['name'], '/users/:userId (DEPRECATED)')
|
|
|
|
def test_request_from_inline_examples(self):
|
|
# item
|
|
item = self.json_data['item'][0]['item'][0]['item'][0]
|
|
self.assertEqual(item['name'], 'Update First Name')
|
|
self.assertEqual(item['request']["method"], 'PATCH')
|
|
self.assertEqual(item['request']["body"]["raw"], '{\n "firstName" : "Rebecca"\n}')
|
|
|
|
|
|
if __name__ == '__main__':
|
|
unittest.main()
|