def test_image_image_kept_if_defined(simple_resource): simple_resource.config.docker.image_defaults.image = "default_image" framework = Namespace(name="n", version="20.0a", image=Namespace(image="automl")) _add_default_image(framework, simple_resource.config) assert framework.image.image == "automl"
def test_image_tag_kept_if_defined(simple_resource): simple_resource.config.docker.image_defaults.tag = "v1.0dev" framework = Namespace(name="n", image=Namespace(tag="1.0-xenial")) _add_default_image(framework, simple_resource.config) assert framework.image.tag == "1.0-xenial"
def test_image_uses_framework_name_if_no_default_image(simple_resource): simple_resource.config.docker.image_defaults.image = None framework = Namespace(name="decision_tree", version="v0.1") _add_default_image(framework, simple_resource.config) assert framework.image.image == "decision_tree"
def test_image_uses_lower_case_version_if_no_default_tag(simple_resource): simple_resource.config.docker.image_defaults.tag = None framework = Namespace(version="V0.2dev", name="n") _add_default_image(framework, simple_resource.config) assert framework.image.tag == "v0.2dev"
def test_image_uses_default_tag(simple_resource): simple_resource.config.docker.image_defaults.tag = "V1" framework = Namespace(version="V0.2dev", name="n") _add_default_image(framework, simple_resource.config) assert framework.image.tag == "V1"
def test_image_author_kept_if_defined(simple_resource): simple_resource.config.docker.image_defaults.author = "author" framework = Namespace(name="n", version="0.1", image=Namespace(author="hfinley")) _add_default_image(framework, simple_resource.config) assert framework.image.author == "hfinley"
def test_image_what_to_do_if_no_default_author(simple_resource): simple_resource.config.docker.image_defaults.author = None framework = Namespace(version="v", name="n") _add_default_image(framework, simple_resource.config) assert framework.image.author == ""
def test_image_uses_default_author(simple_resource): simple_resource.config.docker.image_defaults.author = "unit test author" framework = Namespace(version="v", name="n") _add_default_image(framework, simple_resource.config) assert framework.image.author == "unit test author"