forked from loafle/openapi-generator-original
Adds not to CodegenComposedSchemas and uses it in python-exp (#12146)
Updates docs
This commit is contained in:
@@ -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()
|
||||
@@ -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')
|
||||
|
||||
@@ -92,6 +92,7 @@ class TestFruit(unittest.TestCase):
|
||||
apple.Apple,
|
||||
banana.Banana,
|
||||
],
|
||||
'not': None
|
||||
}
|
||||
)
|
||||
|
||||
|
||||
@@ -78,6 +78,7 @@ class TestFruitReq(unittest.TestCase):
|
||||
apple_req.AppleReq,
|
||||
banana_req.BananaReq,
|
||||
],
|
||||
'not': None
|
||||
}
|
||||
)
|
||||
|
||||
|
||||
@@ -74,6 +74,7 @@ class TestGmFruit(unittest.TestCase):
|
||||
],
|
||||
'allOf': [],
|
||||
'oneOf': [],
|
||||
'not': None
|
||||
}
|
||||
)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user