Update comments in generated unit test stubs

This commit is contained in:
Scott Williams 2016-04-27 22:02:48 +01:00
parent f59c43dffb
commit 066baf3c16
21 changed files with 297 additions and 82 deletions

View File

@ -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()

View File

@ -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()

View File

@ -5,7 +5,7 @@ This Python package is automatically generated by the [Swagger Codegen](https://
- API version: 1.0.0
- Package version: 1.0.0
- Build date: 2016-04-27T20:52:27.297+01:00
- Build date: 2016-04-27T22:01:43.565+01:00
- Build package: class io.swagger.codegen.languages.PythonClientCodegen
## Requirements.

View File

@ -25,10 +25,12 @@ import sys
import unittest
import swagger_client
from swagger_client.rest import ApiException
from swagger_client.models.animal import Animal
class AnimalTest(unittest.TestCase):
class TestAnimal(unittest.TestCase):
""" Animal unit test stubs """
def setUp(self):
pass
@ -36,9 +38,12 @@ class AnimalTest(unittest.TestCase):
def tearDown(self):
pass
"""
Test Animal
"""
def testAnimal(self):
self.model = swagger_client.models.animal.Animal()
"""
Test Animal
"""
model = swagger_client.models.animal.Animal()
if __name__ == '__main__':
unittest.main()

View File

@ -25,10 +25,12 @@ import sys
import unittest
import swagger_client
from swagger_client.rest import ApiException
from swagger_client.models.api_response import ApiResponse
class ApiResponseTest(unittest.TestCase):
class TestApiResponse(unittest.TestCase):
""" ApiResponse unit test stubs """
def setUp(self):
pass
@ -36,9 +38,12 @@ class ApiResponseTest(unittest.TestCase):
def tearDown(self):
pass
"""
Test ApiResponse
"""
def testApiResponse(self):
self.model = swagger_client.models.api_response.ApiResponse()
"""
Test ApiResponse
"""
model = swagger_client.models.api_response.ApiResponse()
if __name__ == '__main__':
unittest.main()

View File

@ -25,10 +25,12 @@ import sys
import unittest
import swagger_client
from swagger_client.rest import ApiException
from swagger_client.models.cat import Cat
class CatTest(unittest.TestCase):
class TestCat(unittest.TestCase):
""" Cat unit test stubs """
def setUp(self):
pass
@ -36,9 +38,12 @@ class CatTest(unittest.TestCase):
def tearDown(self):
pass
"""
Test Cat
"""
def testCat(self):
self.model = swagger_client.models.cat.Cat()
"""
Test Cat
"""
model = swagger_client.models.cat.Cat()
if __name__ == '__main__':
unittest.main()

View File

@ -25,10 +25,12 @@ import sys
import unittest
import swagger_client
from swagger_client.rest import ApiException
from swagger_client.models.category import Category
class CategoryTest(unittest.TestCase):
class TestCategory(unittest.TestCase):
""" Category unit test stubs """
def setUp(self):
pass
@ -36,9 +38,12 @@ class CategoryTest(unittest.TestCase):
def tearDown(self):
pass
"""
Test Category
"""
def testCategory(self):
self.model = swagger_client.models.category.Category()
"""
Test Category
"""
model = swagger_client.models.category.Category()
if __name__ == '__main__':
unittest.main()

View File

@ -25,10 +25,12 @@ import sys
import unittest
import swagger_client
from swagger_client.rest import ApiException
from swagger_client.models.dog import Dog
class DogTest(unittest.TestCase):
class TestDog(unittest.TestCase):
""" Dog unit test stubs """
def setUp(self):
pass
@ -36,9 +38,12 @@ class DogTest(unittest.TestCase):
def tearDown(self):
pass
"""
Test Dog
"""
def testDog(self):
self.model = swagger_client.models.dog.Dog()
"""
Test Dog
"""
model = swagger_client.models.dog.Dog()
if __name__ == '__main__':
unittest.main()

View File

@ -25,9 +25,12 @@ import sys
import unittest
import swagger_client
from swagger_client.rest import ApiException
from swagger_client.apis.fake_api import FakeApi
class FakeApiTest(unittest.TestCase):
class TestFakeApi(unittest.TestCase):
""" FakeApi unit test stubs """
def setUp(self):
self.api = swagger_client.apis.fake_api.FakeApi()
@ -36,5 +39,13 @@ class FakeApiTest(unittest.TestCase):
pass
def test_test_endpoint_parameters(self):
"""
Test case for test_endpoint_parameters
Fake endpoint for testing various parameters
"""
pass
if __name__ == '__main__':
unittest.main()

View File

@ -25,10 +25,12 @@ import sys
import unittest
import swagger_client
from swagger_client.rest import ApiException
from swagger_client.models.format_test import FormatTest
class FormatTestTest(unittest.TestCase):
class TestFormatTest(unittest.TestCase):
""" FormatTest unit test stubs """
def setUp(self):
pass
@ -36,9 +38,12 @@ class FormatTestTest(unittest.TestCase):
def tearDown(self):
pass
"""
Test FormatTest
"""
def testFormatTest(self):
self.model = swagger_client.models.format_test.FormatTest()
"""
Test FormatTest
"""
model = swagger_client.models.format_test.FormatTest()
if __name__ == '__main__':
unittest.main()

View File

@ -25,10 +25,12 @@ import sys
import unittest
import swagger_client
from swagger_client.rest import ApiException
from swagger_client.models.model_200_response import Model200Response
class Model200ResponseTest(unittest.TestCase):
class TestModel200Response(unittest.TestCase):
""" Model200Response unit test stubs """
def setUp(self):
pass
@ -36,9 +38,12 @@ class Model200ResponseTest(unittest.TestCase):
def tearDown(self):
pass
"""
Test Model200Response
"""
def testModel200Response(self):
self.model = swagger_client.models.model_200_response.Model200Response()
"""
Test Model200Response
"""
model = swagger_client.models.model_200_response.Model200Response()
if __name__ == '__main__':
unittest.main()

View File

@ -25,10 +25,12 @@ import sys
import unittest
import swagger_client
from swagger_client.rest import ApiException
from swagger_client.models.model_return import ModelReturn
class ModelReturnTest(unittest.TestCase):
class TestModelReturn(unittest.TestCase):
""" ModelReturn unit test stubs """
def setUp(self):
pass
@ -36,9 +38,12 @@ class ModelReturnTest(unittest.TestCase):
def tearDown(self):
pass
"""
Test ModelReturn
"""
def testModelReturn(self):
self.model = swagger_client.models.model_return.ModelReturn()
"""
Test ModelReturn
"""
model = swagger_client.models.model_return.ModelReturn()
if __name__ == '__main__':
unittest.main()

View File

@ -25,10 +25,12 @@ import sys
import unittest
import swagger_client
from swagger_client.rest import ApiException
from swagger_client.models.name import Name
class NameTest(unittest.TestCase):
class TestName(unittest.TestCase):
""" Name unit test stubs """
def setUp(self):
pass
@ -36,9 +38,12 @@ class NameTest(unittest.TestCase):
def tearDown(self):
pass
"""
Test Name
"""
def testName(self):
self.model = swagger_client.models.name.Name()
"""
Test Name
"""
model = swagger_client.models.name.Name()
if __name__ == '__main__':
unittest.main()

View File

@ -25,10 +25,12 @@ import sys
import unittest
import swagger_client
from swagger_client.rest import ApiException
from swagger_client.models.order import Order
class OrderTest(unittest.TestCase):
class TestOrder(unittest.TestCase):
""" Order unit test stubs """
def setUp(self):
pass
@ -36,9 +38,12 @@ class OrderTest(unittest.TestCase):
def tearDown(self):
pass
"""
Test Order
"""
def testOrder(self):
self.model = swagger_client.models.order.Order()
"""
Test Order
"""
model = swagger_client.models.order.Order()
if __name__ == '__main__':
unittest.main()

View File

@ -25,10 +25,12 @@ import sys
import unittest
import swagger_client
from swagger_client.rest import ApiException
from swagger_client.models.pet import Pet
class PetTest(unittest.TestCase):
class TestPet(unittest.TestCase):
""" Pet unit test stubs """
def setUp(self):
pass
@ -36,9 +38,12 @@ class PetTest(unittest.TestCase):
def tearDown(self):
pass
"""
Test Pet
"""
def testPet(self):
self.model = swagger_client.models.pet.Pet()
"""
Test Pet
"""
model = swagger_client.models.pet.Pet()
if __name__ == '__main__':
unittest.main()

View File

@ -25,9 +25,12 @@ import sys
import unittest
import swagger_client
from swagger_client.rest import ApiException
from swagger_client.apis.pet_api import PetApi
class PetApiTest(unittest.TestCase):
class TestPetApi(unittest.TestCase):
""" PetApi unit test stubs """
def setUp(self):
self.api = swagger_client.apis.pet_api.PetApi()
@ -36,26 +39,69 @@ class PetApiTest(unittest.TestCase):
pass
def test_add_pet(self):
"""
Test case for add_pet
Add a new pet to the store
"""
pass
def test_delete_pet(self):
"""
Test case for delete_pet
Deletes a pet
"""
pass
def test_find_pets_by_status(self):
"""
Test case for find_pets_by_status
Finds Pets by status
"""
pass
def test_find_pets_by_tags(self):
"""
Test case for find_pets_by_tags
Finds Pets by tags
"""
pass
def test_get_pet_by_id(self):
"""
Test case for get_pet_by_id
Find pet by ID
"""
pass
def test_update_pet(self):
"""
Test case for update_pet
Update an existing pet
"""
pass
def test_update_pet_with_form(self):
"""
Test case for update_pet_with_form
Updates a pet in the store with form data
"""
pass
def test_upload_file(self):
"""
Test case for upload_file
uploads an image
"""
pass
if __name__ == '__main__':
unittest.main()

View File

@ -25,10 +25,12 @@ import sys
import unittest
import swagger_client
from swagger_client.rest import ApiException
from swagger_client.models.special_model_name import SpecialModelName
class SpecialModelNameTest(unittest.TestCase):
class TestSpecialModelName(unittest.TestCase):
""" SpecialModelName unit test stubs """
def setUp(self):
pass
@ -36,9 +38,12 @@ class SpecialModelNameTest(unittest.TestCase):
def tearDown(self):
pass
"""
Test SpecialModelName
"""
def testSpecialModelName(self):
self.model = swagger_client.models.special_model_name.SpecialModelName()
"""
Test SpecialModelName
"""
model = swagger_client.models.special_model_name.SpecialModelName()
if __name__ == '__main__':
unittest.main()

View File

@ -25,9 +25,12 @@ import sys
import unittest
import swagger_client
from swagger_client.rest import ApiException
from swagger_client.apis.store_api import StoreApi
class StoreApiTest(unittest.TestCase):
class TestStoreApi(unittest.TestCase):
""" StoreApi unit test stubs """
def setUp(self):
self.api = swagger_client.apis.store_api.StoreApi()
@ -36,14 +39,37 @@ class StoreApiTest(unittest.TestCase):
pass
def test_delete_order(self):
"""
Test case for delete_order
Delete purchase order by ID
"""
pass
def test_get_inventory(self):
"""
Test case for get_inventory
Returns pet inventories by status
"""
pass
def test_get_order_by_id(self):
"""
Test case for get_order_by_id
Find purchase order by ID
"""
pass
def test_place_order(self):
"""
Test case for place_order
Place an order for a pet
"""
pass
if __name__ == '__main__':
unittest.main()

View File

@ -25,10 +25,12 @@ import sys
import unittest
import swagger_client
from swagger_client.rest import ApiException
from swagger_client.models.tag import Tag
class TagTest(unittest.TestCase):
class TestTag(unittest.TestCase):
""" Tag unit test stubs """
def setUp(self):
pass
@ -36,9 +38,12 @@ class TagTest(unittest.TestCase):
def tearDown(self):
pass
"""
Test Tag
"""
def testTag(self):
self.model = swagger_client.models.tag.Tag()
"""
Test Tag
"""
model = swagger_client.models.tag.Tag()
if __name__ == '__main__':
unittest.main()

View File

@ -25,10 +25,12 @@ import sys
import unittest
import swagger_client
from swagger_client.rest import ApiException
from swagger_client.models.user import User
class UserTest(unittest.TestCase):
class TestUser(unittest.TestCase):
""" User unit test stubs """
def setUp(self):
pass
@ -36,9 +38,12 @@ class UserTest(unittest.TestCase):
def tearDown(self):
pass
"""
Test User
"""
def testUser(self):
self.model = swagger_client.models.user.User()
"""
Test User
"""
model = swagger_client.models.user.User()
if __name__ == '__main__':
unittest.main()

View File

@ -25,9 +25,12 @@ import sys
import unittest
import swagger_client
from swagger_client.rest import ApiException
from swagger_client.apis.user_api import UserApi
class UserApiTest(unittest.TestCase):
class TestUserApi(unittest.TestCase):
""" UserApi unit test stubs """
def setUp(self):
self.api = swagger_client.apis.user_api.UserApi()
@ -36,26 +39,69 @@ class UserApiTest(unittest.TestCase):
pass
def test_create_user(self):
"""
Test case for create_user
Create user
"""
pass
def test_create_users_with_array_input(self):
"""
Test case for create_users_with_array_input
Creates list of users with given input array
"""
pass
def test_create_users_with_list_input(self):
"""
Test case for create_users_with_list_input
Creates list of users with given input array
"""
pass
def test_delete_user(self):
"""
Test case for delete_user
Delete user
"""
pass
def test_get_user_by_name(self):
"""
Test case for get_user_by_name
Get user by user name
"""
pass
def test_login_user(self):
"""
Test case for login_user
Logs user into the system
"""
pass
def test_logout_user(self):
"""
Test case for logout_user
Logs out current logged in user session
"""
pass
def test_update_user(self):
"""
Test case for update_user
Updated user
"""
pass
if __name__ == '__main__':
unittest.main()