docker-pi-hole/test/test_start.py

13 lines
492 B
Python
Raw Normal View History

import pytest
def test_ServerIP_missing_env_triggers_error(Command):
start = Command.run('/start.sh')
error_msg = "ERROR: To function correctly you must pass an environment variables of 'ServerIP' into the docker container"
assert start.rc == 1
assert error_msg in start.stdout
@pytest.mark.docker_args('-e ServerIP="192.168.1.2"')
@pytest.mark.docker_cmd('/start.sh')
def test_ServerIP_allows_normal_startup(Command):
assert Command.run('pgrep -f /start.sh | wc') != 0