repo2docker/tests/test_subdir.py

31 wiersze
811 B
Python
Czysty Zwykły widok Historia

2018-09-26 17:01:58 +00:00
"""
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
repo_path = dirname(dirname(abspath(__file__)))
2018-09-26 22:33:52 +00:00
def test_subdir(run_repo2docker):
2018-09-26 17:01:58 +00:00
argv = ['--subdir', 'tests/conda/simple', repo_path]
2018-09-26 22:33:52 +00:00
run_repo2docker(argv)
2018-09-26 17:01:58 +00:00
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"