Skip to content
This repository was archived by the owner on Jun 2, 2026. It is now read-only.

Commit e63b7cf

Browse files
authored
Merge pull request #29 from fopina/minor
integration tests and other minor tweaks
2 parents abd3108 + afe4034 commit e63b7cf

48 files changed

Lines changed: 49033 additions & 23 deletions

Some content is hidden

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

.github/workflows/test.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -79,6 +79,6 @@ jobs:
7979
pipenv requirements --dev > reqs.txt
8080
pip install -r reqs.txt
8181
82-
- name: Run unit tests
82+
- name: Run e2e tests
8383
run: |
84-
python example.py
84+
make test-e2e

.openapi-generator-ignore

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
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
24+
*README.md

.openapi-generator/FILES

Lines changed: 734 additions & 0 deletions
Large diffs are not rendered by default.

.openapi-generator/VERSION

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
7.13.0

Makefile

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,15 +15,21 @@ test:
1515
python -m pytest --cov; \
1616
fi
1717

18+
test-e2e: export DD_INTEGRATION_TESTS=1
19+
test-e2e:
20+
python -m pytest tests/integration
21+
1822
testpub:
1923
rm -fr dist
2024
pyproject-build
2125
twine upload --repository testpypi dist/*
2226

2327
schema:
24-
curl "https://demo.defectdojo.org/api/v2/oa3/schema/?format=json" -o support/openapi.json
28+
./support/fetch_openapi.py
2529

26-
generate:
30+
templates:
2731
./support/api_generation/dump_templates.sh
32+
33+
generate:
2834
./support/api_generation/generate.sh
2935
$(MAKE) lint

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ line-ending = "auto"
5151

5252
[tool.pytest.ini_options]
5353
minversion = "6.0"
54-
addopts = "-ra -q --disable-socket"
54+
addopts = "-ra -q --disable-socket --allow-hosts=127.0.0.1"
5555
testpaths = [
5656
"tests",
5757
]

support/api_generation/config.yaml

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,13 @@
1-
templateDir: local/support/api_generation/templates.spec
1+
generatorName: python
2+
templateDir: support/api_generation/custom_templates
23
additionalProperties:
34
generateSourceCodeOnly: true
45
packageName: defectdojo_api_generated
6+
packageUrl: https://github.com/fopina/defectdojo-api-generated
7+
projectName: defectdojo-api-generated
8+
globalProperties:
9+
modelDocs: false
10+
apiDocs: false
511
files:
612
client.mustache:
713
folder: defectdojo_api_generated
Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,60 @@
1+
# {{{projectName}}}
2+
{{#appDescriptionWithNewLines}}
3+
{{{.}}}
4+
{{/appDescriptionWithNewLines}}
5+
6+
This Python package is automatically generated by the [OpenAPI Generator](https://openapi-generator.tech) project:
7+
8+
- API version: {{appVersion}}
9+
- Package version: {{packageVersion}}
10+
{{^hideGenerationTimestamp}}
11+
- Build date: {{generatedDate}}
12+
{{/hideGenerationTimestamp}}
13+
- Generator version: {{generatorVersion}}
14+
- Build package: {{generatorClass}}
15+
{{#infoUrl}}
16+
For more information, please visit [{{{infoUrl}}}]({{{infoUrl}}})
17+
{{/infoUrl}}
18+
19+
## Requirements.
20+
21+
Python {{{generatorLanguageVersion}}}
22+
23+
## Installation & Usage
24+
### pip install
25+
26+
If the python package is hosted on a repository, you can install directly using:
27+
28+
```sh
29+
pip install git+https://{{gitHost}}/{{{gitUserId}}}/{{{gitRepoId}}}.git
30+
```
31+
(you may need to run `pip` with root permission: `sudo pip install git+https://{{gitHost}}/{{{gitUserId}}}/{{{gitRepoId}}}.git`)
32+
33+
Then import the package:
34+
```python
35+
import {{{packageName}}}
36+
```
37+
38+
### Setuptools
39+
40+
Install via [Setuptools](http://pypi.python.org/pypi/setuptools).
41+
42+
```sh
43+
python setup.py install --user
44+
```
45+
(or `sudo python setup.py install` to install the package for all users)
46+
47+
Then import the package:
48+
```python
49+
import {{{packageName}}}
50+
```
51+
52+
### Tests
53+
54+
Execute `pytest` to run the tests.
55+
56+
## Getting Started
57+
58+
Please follow the [installation procedure](#installation--usage) and then run the following:
59+
60+
{{> common_README }}
Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
# {{{projectName}}}
2+
{{#appDescription}}
3+
{{{.}}}
4+
{{/appDescription}}
5+
6+
The `{{packageName}}` package is automatically generated by the [OpenAPI Generator](https://openapi-generator.tech) project:
7+
8+
- API version: {{appVersion}}
9+
- Package version: {{packageVersion}}
10+
{{^hideGenerationTimestamp}}
11+
- Build date: {{generatedDate}}
12+
{{/hideGenerationTimestamp}}
13+
- Generator version: {{generatorVersion}}
14+
- Build package: {{generatorClass}}
15+
{{#infoUrl}}
16+
For more information, please visit [{{{infoUrl}}}]({{{infoUrl}}})
17+
{{/infoUrl}}
18+
19+
## Requirements.
20+
21+
Python {{{generatorLanguageVersion}}}
22+
23+
## Installation & Usage
24+
25+
This python library package is generated without supporting files like setup.py or requirements files
26+
27+
To be able to use it, you will need these dependencies in your own package that uses this library:
28+
29+
* urllib3 >= 2.1.0, < 3.0.0
30+
* python-dateutil >= 2.8.2
31+
{{#asyncio}}
32+
* aiohttp >= 3.8.4
33+
* aiohttp-retry >= 2.8.3
34+
{{/asyncio}}
35+
{{#tornado}}
36+
* tornado >= 4.2, < 5
37+
{{/tornado}}
38+
{{#hasHttpSignatureMethods}}
39+
* pem >= 19.3.0
40+
* pycryptodome >= 3.9.0
41+
{{/hasHttpSignatureMethods}}
42+
* pydantic >= 2
43+
* typing-extensions >= 4.7.1
44+
45+
## Getting Started
46+
47+
In your own code, to use this library to connect and interact with {{{projectName}}},
48+
you can run the following:
49+
50+
{{> common_README }}

support/api_generation/custom_templates/__init__.mustache

Whitespace-only changes.

0 commit comments

Comments
 (0)