add subdir test

pull/413/head
Derek Ludwig 2018-09-26 10:01:58 -07:00
rodzic 39cf2411f9
commit 2e63ec8704
1 zmienionych plików z 29 dodań i 0 usunięć

Wyświetl plik

@ -0,0 +1,29 @@
"""
Test if the explict hostname is supplied correctly to the container
"""
import logging
from os.path import abspath, dirname
import pytest
from repo2docker.app import Repo2Docker
from tests.conftest import make_test_func
repo_path = dirname(dirname(abspath(__file__)))
def test_subdir():
argv = ['--subdir', 'tests/conda/simple', repo_path]
make_test_func(argv)()
def test_subdir_invalid(caplog):
caplog.set_level(logging.INFO, logger='Repo2Docker')
app = Repo2Docker()
argv = ['--subdir', 'tests/conda/invalid', repo_path]
app.initialize(argv)
app.debug = True
app.run = False
with pytest.raises(SystemExit):
app.start() # Just build the image and do not run it.
# Can't get this to record the logs?
# assert caplog.text == "Subdirectory tests/conda/invalid does not exist"