Adds not to CodegenComposedSchemas and uses it in python-exp (#12146)

Updates docs
This commit is contained in:
Justin Black
2022-04-17 09:36:09 -07:00
committed by GitHub
parent 84167ca3db
commit e2e7609bac
189 changed files with 1039 additions and 58 deletions

View File

@@ -0,0 +1,40 @@
# coding: utf-8
"""
OpenAPI Petstore
This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501
The version of the OpenAPI document: 1.0.0
Generated by: https://openapi-generator.tech
"""
import unittest
import petstore_api
from petstore_api.model.any_type_not_string import AnyTypeNotString
class TestAnyTypeNotString(unittest.TestCase):
"""AnyTypeNotString unit test stubs"""
def test_AnyTypeNotString(self):
# valid values work
valid_values = [
True,
None,
0,
3.14,
[],
{}
]
for valid_value in valid_values:
AnyTypeNotString(valid_value)
# invalid value raises an exception
with self.assertRaises(petstore_api.ApiValueError):
AnyTypeNotString('')
if __name__ == '__main__':
unittest.main()

View File

@@ -50,6 +50,7 @@ class TestAnyTypeSchema(unittest.TestCase):
],
'anyOf': [
],
'not': None
}
m = Model(a=1, b='hi')
@@ -74,6 +75,7 @@ class TestAnyTypeSchema(unittest.TestCase):
],
'anyOf': [
],
'not': None
}
m = Model([1, 'hi'])
@@ -98,6 +100,7 @@ class TestAnyTypeSchema(unittest.TestCase):
],
'anyOf': [
],
'not': None
}
m = Model('hi')
@@ -122,6 +125,7 @@ class TestAnyTypeSchema(unittest.TestCase):
],
'anyOf': [
],
'not': None
}
m = Model(1)
@@ -153,6 +157,7 @@ class TestAnyTypeSchema(unittest.TestCase):
],
'anyOf': [
],
'not': None
}
m = Model(1)
@@ -181,6 +186,7 @@ class TestAnyTypeSchema(unittest.TestCase):
],
'anyOf': [
],
'not': None
}
m = Model(True)
@@ -212,6 +218,7 @@ class TestAnyTypeSchema(unittest.TestCase):
],
'anyOf': [
],
'not': None
}
m = Model(None)
@@ -236,6 +243,7 @@ class TestAnyTypeSchema(unittest.TestCase):
],
'anyOf': [
],
'not': None
}
m = Model('1970-01-01')
@@ -260,6 +268,7 @@ class TestAnyTypeSchema(unittest.TestCase):
],
'anyOf': [
],
'not': None
}
m = Model('2020-01-01T00:00:00')
@@ -284,6 +293,7 @@ class TestAnyTypeSchema(unittest.TestCase):
],
'anyOf': [
],
'not': None
}
m = Model('12.34')

View File

@@ -92,6 +92,7 @@ class TestFruit(unittest.TestCase):
apple.Apple,
banana.Banana,
],
'not': None
}
)

View File

@@ -78,6 +78,7 @@ class TestFruitReq(unittest.TestCase):
apple_req.AppleReq,
banana_req.BananaReq,
],
'not': None
}
)

View File

@@ -74,6 +74,7 @@ class TestGmFruit(unittest.TestCase):
],
'allOf': [],
'oneOf': [],
'not': None
}
)