Skip to content
This repository was archived by the owner on Dec 25, 2024. It is now read-only.

Commit fb9df1f

Browse files
committed
Adds testing of new sample
1 parent 5bf44bf commit fb9df1f

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

56 files changed

+6740
-0
lines changed

CI/circle_parallel.sh

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,7 @@ elif [ "$NODE_INDEX" = "4" ]; then
6363
#mvn --no-snapshot-updates --quiet verify -Psamples.circleci.node4 -Dorg.slf4j.simpleLogger.defaultLogLevel=error
6464
(cd samples/openapi3/client/petstore/python && make test)
6565
(cd samples/openapi3/client/3_0_3_unit_test/python && make test)
66+
(cd samples/openapi3/client/features/nonCompliantUseDiscriminatorIfCompositionFails/python && make test)
6667

6768
else
6869
echo "Running node $NODE_INDEX"
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
generatorName: python
2+
outputDir: samples/openapi3/client/features/nonCompliantUseDiscriminatorIfCompositionFails/python
3+
inputSpec: modules/openapi-json-schema-generator/src/test/resources/3_0/nonCompliantUseDiscriminatorIfCompositionFails.yaml
4+
additionalProperties:
5+
packageName: this_package
6+
nonCompliantUseDiscriminatorIfCompositionFails: true
Lines changed: 78 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,78 @@
1+
openapi: 3.0.0
2+
x-stoplight:
3+
id: mjnw03vw4ju5m
4+
info:
5+
title: discriminator-test
6+
version: '1.0'
7+
servers:
8+
- url: 'http://localhost:3000'
9+
paths:
10+
/operators:
11+
post:
12+
summary: ''
13+
operationId: post-operators
14+
responses:
15+
'200':
16+
description: OK
17+
requestBody:
18+
content:
19+
application/json:
20+
schema:
21+
$ref: '#/components/schemas/Operator'
22+
components:
23+
schemas:
24+
AdditionOperator:
25+
type: object
26+
title: AdditionOperator
27+
x-stoplight:
28+
id: qtffupdjxr76d
29+
description: ''
30+
additionalProperties: false
31+
properties:
32+
a:
33+
type: number
34+
format: double
35+
b:
36+
type: number
37+
format: double
38+
operator_id:
39+
type: string
40+
default: ADD
41+
required:
42+
- a
43+
- b
44+
- operator_id
45+
Operator:
46+
title: Operator
47+
x-stoplight:
48+
id: gz5qgm5j0vayg
49+
oneOf:
50+
- $ref: '#/components/schemas/AdditionOperator'
51+
- $ref: '#/components/schemas/SubtractionOperator'
52+
discriminator:
53+
propertyName: operator_id
54+
mapping:
55+
ADD: '#/components/schemas/AdditionOperator'
56+
SUB: '#/components/schemas/SubtractionOperator'
57+
description: ''
58+
SubtractionOperator:
59+
type: object
60+
title: SubtractionOperator
61+
x-stoplight:
62+
id: qtffupdjxr76d
63+
description: ''
64+
additionalProperties: false
65+
properties:
66+
a:
67+
type: number
68+
format: double
69+
b:
70+
type: number
71+
format: double
72+
operator_id:
73+
type: string
74+
default: SUB
75+
required:
76+
- a
77+
- b
78+
- operator_id
Lines changed: 67 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,67 @@
1+
# Byte-compiled / optimized / DLL files
2+
__pycache__/
3+
*.py[cod]
4+
*$py.class
5+
6+
# C extensions
7+
*.so
8+
9+
# Distribution / packaging
10+
.Python
11+
env/
12+
build/
13+
develop-eggs/
14+
dist/
15+
downloads/
16+
eggs/
17+
.eggs/
18+
lib/
19+
lib64/
20+
parts/
21+
sdist/
22+
var/
23+
*.egg-info/
24+
.installed.cfg
25+
*.egg
26+
27+
# PyInstaller
28+
# Usually these files are written by a python script from a template
29+
# before PyInstaller builds the exe, so as to inject date/other infos into it.
30+
*.manifest
31+
*.spec
32+
33+
# Installer logs
34+
pip-log.txt
35+
pip-delete-this-directory.txt
36+
dev-requirements.txt.log
37+
38+
# Unit test / coverage reports
39+
htmlcov/
40+
.tox/
41+
.coverage
42+
.coverage.*
43+
.cache
44+
nosetests.xml
45+
coverage.xml
46+
*,cover
47+
.hypothesis/
48+
venv/
49+
.venv/
50+
.python-version
51+
.pytest_cache
52+
53+
# Translations
54+
*.mo
55+
*.pot
56+
57+
# Django stuff:
58+
*.log
59+
60+
# Sphinx documentation
61+
docs/_build/
62+
63+
# PyBuilder
64+
target/
65+
66+
#Ipython Notebook
67+
.ipynb_checkpoints
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
# ref: https://docs.gitlab.com/ee/ci/README.html
2+
3+
stages:
4+
- test
5+
6+
.tests:
7+
stage: test
8+
script:
9+
- pip install -r requirements.txt
10+
- pip install -r test-requirements.txt
11+
- pytest --cov=this_package
12+
13+
test-3.5:
14+
extends: .tests
15+
image: python:3.5-alpine
16+
test-3.6:
17+
extends: .tests
18+
image: python:3.6-alpine
19+
test-3.7:
20+
extends: .tests
21+
image: python:3.7-alpine
22+
test-3.8:
23+
extends: .tests
24+
image: python:3.8-alpine
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
# OpenAPI Generator Ignore
2+
# Generated by openapi-generator https://github.com/openapitools/openapi-generator
3+
4+
# Use this file to prevent files from being overwritten by the generator.
5+
# The patterns follow closely to .gitignore or .dockerignore.
6+
7+
# As an example, the C# client generator defines ApiClient.cs.
8+
# You can make changes and tell OpenAPI Generator to ignore just this file by uncommenting the following line:
9+
#ApiClient.cs
10+
11+
# You can match any string of characters against a directory, file or extension with a single asterisk (*):
12+
#foo/*/qux
13+
# The above matches foo/bar/qux and foo/baz/qux, but not foo/bar/baz/qux
14+
15+
# You can recursively match patterns against a directory, file or extension with a double asterisk (**):
16+
#foo/**/qux
17+
# This matches foo/bar/qux, foo/baz/qux, and foo/bar/baz/qux
18+
19+
# You can also negate patterns with an exclamation (!).
20+
# For example, you can ignore all files in a docs folder with the file extension .md:
21+
#docs/*.md
22+
# Then explicitly reverse the ignore rule for a single file:
23+
#!docs/README.md
Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
.gitignore
2+
.gitlab-ci.yml
3+
.openapi-generator-ignore
4+
.travis.yml
5+
README.md
6+
docs/apis/tags/DefaultApi.md
7+
docs/models/AdditionOperator.md
8+
docs/models/Operator.md
9+
docs/models/SubtractionOperator.md
10+
git_push.sh
11+
requirements.txt
12+
setup.cfg
13+
setup.py
14+
test-requirements.txt
15+
test/__init__.py
16+
test/test_models/__init__.py
17+
test/test_models/test_addition_operator.py
18+
test/test_models/test_operator.py
19+
test/test_models/test_subtraction_operator.py
20+
this_package/__init__.py
21+
this_package/api_client.py
22+
this_package/apis/__init__.py
23+
this_package/apis/tags/default_api.py
24+
this_package/configuration.py
25+
this_package/exceptions.py
26+
this_package/model/__init__.py
27+
this_package/model/addition_operator.py
28+
this_package/model/addition_operator.pyi
29+
this_package/model/operator.py
30+
this_package/model/operator.pyi
31+
this_package/model/subtraction_operator.py
32+
this_package/model/subtraction_operator.pyi
33+
this_package/models/__init__.py
34+
this_package/rest.py
35+
this_package/schemas.py
36+
tox.ini
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
1.0.0-SNAPSHOT
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
# ref: https://docs.travis-ci.com/user/languages/python
2+
language: python
3+
python:
4+
- "3.5"
5+
- "3.6"
6+
- "3.7"
7+
- "3.8"
8+
# command to install dependencies
9+
install:
10+
- "pip install -r requirements.txt"
11+
- "pip install -r test-requirements.txt"
12+
# command to run tests
13+
script: pytest --cov=this_package
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
REQUIREMENTS_FILE=dev-requirements.txt
2+
REQUIREMENTS_OUT=dev-requirements.txt.log
3+
SETUP_OUT=*.egg-info
4+
VENV=venv
5+
6+
clean:
7+
rm -rf $(REQUIREMENTS_OUT)
8+
rm -rf $(SETUP_OUT)
9+
rm -rf $(VENV)
10+
rm -rf .tox
11+
rm -rf .coverage
12+
find . -name "*.py[oc]" -delete
13+
find . -name "__pycache__" -delete
14+
15+
test: clean
16+
bash ./test_python.sh

0 commit comments

Comments
 (0)