1
0
mirror of https://github.com/pi-hole/pi-hole synced 2024-12-22 06:48:07 +00:00
Signed-off-by: Adam Hill <adam@diginc.us>
This commit is contained in:
Adam Hill 2018-07-11 23:23:32 -05:00
parent fff31558a0
commit 88e4b6390c
No known key found for this signature in database
GPG Key ID: 2193804FCA429855
6 changed files with 35 additions and 2 deletions

4
.gitignore vendored
View File

@ -4,6 +4,10 @@
__pycache__
.cache
.pytest_cache
.tox
.eggs
*.egg-info
# Created by https://www.gitignore.io/api/jetbrains+iml

View File

@ -9,6 +9,5 @@ install:
script:
# run tasks marked as 'build_stage' first (ensure docker images are built)
- py.test -vv -n auto -m "build_stage"
# run the remaining tasks in the test suite
- py.test -vv -n auto -m "not build_stage"
- tox

View File

@ -3,3 +3,4 @@ pytest
pytest-xdist
pytest-cov
testinfra
tox

6
setup.py Normal file
View File

@ -0,0 +1,6 @@
from setuptools import setup
setup(
setup_requires=['pytest-runner'],
tests_require=['pytest'],
)

13
test/README.md Normal file
View File

@ -0,0 +1,13 @@
# How do I test?
Make sure you have Docker and Python w/pip package manager.
From command line all you need to do is:
- `pip install tox`
- `tox`
# How do I debug python?
Highly recommended: Setup PyCharm on a **Docker enabled** machine. Having a python debugger like PyCharm changes your life if you've never used it :)

10
tox.ini Normal file
View File

@ -0,0 +1,10 @@
[tox]
envlist = py27
[testenv]
whitelist_externals = docker
deps = -rrequirements.txt
commands = docker build -f test/debian.Dockerfile -t pytest_pihole:debian .
docker build -f test/centos.Dockerfile -t pytest_pihole:centos .
docker build -f test/fedora.Dockerfile -t pytest_pihole:fedora .
pytest {posargs:-vv -n auto} -m "not build_stage" ./test/