forked from loafle/openapi-generator-original
Update comments in generated unit test stubs
This commit is contained in:
@@ -25,9 +25,12 @@ import sys
|
||||
import unittest
|
||||
|
||||
import swagger_client
|
||||
from swagger_client.rest import ApiException
|
||||
from swagger_client.apis.{{classVarName}} import {{classname}}
|
||||
|
||||
class {{#operations}}{{classname}}Test(unittest.TestCase):
|
||||
|
||||
class {{#operations}}Test{{classname}}(unittest.TestCase):
|
||||
""" {{classname}} unit test stubs """
|
||||
|
||||
def setUp(self):
|
||||
self.api = swagger_client.apis.{{classVarName}}.{{classname}}()
|
||||
@@ -37,7 +40,15 @@ class {{#operations}}{{classname}}Test(unittest.TestCase):
|
||||
|
||||
{{#operation}}
|
||||
def test_{{operationId}}(self):
|
||||
"""
|
||||
Test case for {{{operationId}}}
|
||||
|
||||
{{{summary}}}
|
||||
"""
|
||||
pass
|
||||
|
||||
{{/operation}}
|
||||
{{/operations}}
|
||||
{{/operations}}
|
||||
|
||||
if __name__ == '__main__':
|
||||
unittest.main()
|
||||
@@ -27,10 +27,12 @@ import unittest
|
||||
{{#models}}
|
||||
{{#model}}
|
||||
import swagger_client
|
||||
from swagger_client.rest import ApiException
|
||||
from swagger_client.models.{{classFilename}} import {{classname}}
|
||||
|
||||
|
||||
class {{classname}}Test(unittest.TestCase):
|
||||
class Test{{classname}}(unittest.TestCase):
|
||||
""" {{classname}} unit test stubs """
|
||||
|
||||
def setUp(self):
|
||||
pass
|
||||
@@ -38,11 +40,14 @@ class {{classname}}Test(unittest.TestCase):
|
||||
def tearDown(self):
|
||||
pass
|
||||
|
||||
"""
|
||||
Test {{classname}}
|
||||
"""
|
||||
def test{{classname}}(self):
|
||||
self.model = swagger_client.models.{{classFilename}}.{{classname}}()
|
||||
"""
|
||||
Test {{classname}}
|
||||
"""
|
||||
model = swagger_client.models.{{classFilename}}.{{classname}}()
|
||||
|
||||
{{/model}}
|
||||
{{/models}}
|
||||
|
||||
if __name__ == '__main__':
|
||||
unittest.main()
|
||||
Reference in New Issue
Block a user