forked from loafle/openapi-generator-original
Enhancements intergration-test of python client
This commit is contained in:
parent
23dfac0194
commit
c88c85a317
3
.gitignore
vendored
3
.gitignore
vendored
@ -45,3 +45,6 @@ samples/client/petstore/php/SwaggerClient-php/vendor/
|
||||
|
||||
samples/client/petstore/silex/SwaggerServer/composer.lock
|
||||
samples/client/petstore/silex/SwaggerServer/venodr/
|
||||
|
||||
samples/client/petstore/python/.projectile
|
||||
samples/client/petstore/python/.venv/
|
||||
|
12
samples/client/petstore/python/.travis.yml
Normal file
12
samples/client/petstore/python/.travis.yml
Normal file
@ -0,0 +1,12 @@
|
||||
language: python
|
||||
python:
|
||||
- "2.6"
|
||||
- "2.7"
|
||||
- "3.2"
|
||||
- "3.3"
|
||||
- "3.4"
|
||||
install:
|
||||
- pip install . --use-mirrors
|
||||
- pip install -r dev-requirements.txt --use-mirrors
|
||||
script:
|
||||
- nosetests
|
@ -1,22 +1,9 @@
|
||||
#!/bin/sh
|
||||
|
||||
REQUIREMENTS_FILE=dev-requirements.txt
|
||||
REQUIREMENTS_OUT=dev-requirements.txt.log
|
||||
SETUP_OUT=*.egg-info
|
||||
|
||||
virtualenv:
|
||||
ifndef VIRTUAL_ENV
|
||||
$(error Must be run inside of a virtualenv\
|
||||
http://docs.python-guide.org/en/latest/dev/virtualenvs/)
|
||||
endif
|
||||
|
||||
setup: virtualenv $(SETUP_OUT)
|
||||
|
||||
$(SETUP_OUT): setup.py setup.cfg
|
||||
python setup.py develop
|
||||
touch $(SETUP_OUT)
|
||||
|
||||
$(REQUIREMENTS_OUT): $(REQUIREMENTS_FILE)
|
||||
pip install -r $(REQUIREMENTS_FILE) | tee -a $(REQUIREMENTS_OUT)
|
||||
python setup.py develop
|
||||
VENV=.venv
|
||||
|
||||
clean:
|
||||
rm -rf $(REQUIREMENTS_OUT)
|
||||
@ -26,12 +13,8 @@ clean:
|
||||
find . -name "*.py[oc]" -delete
|
||||
find . -name "__pycache__" -delete
|
||||
|
||||
requirements: setup $(REQUIREMENTS_OUT)
|
||||
|
||||
test: clean requirements
|
||||
nosetests
|
||||
|
||||
test-all: clean requirements
|
||||
tox
|
||||
|
||||
test: clean
|
||||
sh ./test.sh
|
||||
|
||||
test-all: clean
|
||||
sh ./test-all.sh
|
||||
|
@ -26,6 +26,20 @@
|
||||
<artifactId>exec-maven-plugin</artifactId>
|
||||
<version>1.2.1</version>
|
||||
<executions>
|
||||
<execution>
|
||||
<id>pip-install</id>
|
||||
<phase>pre-integration-test</phase>
|
||||
<goals>
|
||||
<goal>exec</goal>
|
||||
</goals>
|
||||
<configuration>
|
||||
<executable>pip</executable>
|
||||
<arguments>
|
||||
<argument>install</argument>
|
||||
<argument>virtualenv</argument>
|
||||
</arguments>
|
||||
</configuration>
|
||||
</execution>
|
||||
<execution>
|
||||
<id>nose-test</id>
|
||||
<phase>integration-test</phase>
|
||||
@ -44,14 +58,3 @@
|
||||
</plugins>
|
||||
</build>
|
||||
</project>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
19
samples/client/petstore/python/test-all.sh
Executable file
19
samples/client/petstore/python/test-all.sh
Executable file
@ -0,0 +1,19 @@
|
||||
#!/bin/sh
|
||||
|
||||
REQUIREMENTS_FILE=dev-requirements.txt
|
||||
REQUIREMENTS_OUT=dev-requirements.txt.log
|
||||
SETUP_OUT=*.egg-info
|
||||
VENV=.venv
|
||||
|
||||
### set virtualenv
|
||||
if [ -z "$VIRTUAL_ENV" ]; then
|
||||
virtualenv $VENV --no-site-packages
|
||||
source $VENV/bin/activate
|
||||
fi
|
||||
|
||||
### install dependencies
|
||||
pip install -r $REQUIREMENTS_FILE | tee -a $REQUIREMENTS_OUT
|
||||
python setup.py develop
|
||||
|
||||
### run tests
|
||||
tox
|
19
samples/client/petstore/python/test.sh
Executable file
19
samples/client/petstore/python/test.sh
Executable file
@ -0,0 +1,19 @@
|
||||
#!/bin/sh
|
||||
|
||||
REQUIREMENTS_FILE=dev-requirements.txt
|
||||
REQUIREMENTS_OUT=dev-requirements.txt.log
|
||||
SETUP_OUT=*.egg-info
|
||||
VENV=.venv
|
||||
|
||||
### set virtualenv
|
||||
if [ -z "$VIRTUAL_ENV" ]; then
|
||||
virtualenv $VENV --no-site-packages
|
||||
source $VENV/bin/activate
|
||||
fi
|
||||
|
||||
### install dependencies
|
||||
pip install -r $REQUIREMENTS_FILE | tee -a $REQUIREMENTS_OUT
|
||||
python setup.py develop
|
||||
|
||||
### run tests
|
||||
nosetests
|
Loading…
x
Reference in New Issue
Block a user