kopia lustrzana https://github.com/jupyterhub/repo2docker
Add test for valid & invalid docker image names
rodzic
183d504515
commit
0a1d9e3d5f
|
@ -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):
|
||||
"""
|
||||
|
|
|
@ -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', '.'])
|
Ładowanie…
Reference in New Issue