Add test for valid & invalid docker image names

pull/496/head
yuvipanda 2018-12-13 14:16:28 -08:00
rodzic 183d504515
commit 0a1d9e3d5f
2 zmienionych plików z 10 dodań i 2 usunięć

Wyświetl plik

@ -5,7 +5,7 @@ import logging
import docker
from .app import Repo2Docker
from . import __version__
from .utils import validate_and_generate_port_mapping
from .utils import validate_and_generate_port_mapping, is_valid_docker_image_name
def validate_image_name(image_name):
"""

Wyświetl plik

@ -76,4 +76,12 @@ def test_clean():
# Don't clean by default when repo exists locally
assert not make_r2d(['.']).cleanup_checkout
# Don't clean when repo exists locally and we explicitly ask it to not clean
assert not make_r2d(['--no-clean', '.']).cleanup_checkout
assert not make_r2d(['--no-clean', '.']).cleanup_checkout
def test_invalid_image_name():
"""
Test validating image names
"""
with pytest.raises(SystemExit):
make_r2d(['--image-name', '_invalid', '.'])