Ejemplo n.º 1
0
def test_imagename_load_from_empty() -> None:
    """Test loading empty file as ImageName."""
    with pytest.raises(TypeError):
        with open(YAML_EMPTY) as fp:
            ImageName.load_from_file(fp)
Ejemplo n.º 2
0
def test_imagename_load_partial() -> None:
    """Test loading a partial ImageName."""
    with open(IMAGENAME_PARTIAL) as fp:
        assert ImageName.load_from_file(fp) == ImageName("eee")
Ejemplo n.º 3
0
def test_imagename_load_invalid() -> None:
    """Test loading an invalid ImageName."""
    with pytest.raises(ValidationError):
        with open(IMAGENAME_INVALID) as fp:
            ImageName.load_from_file(fp)
Ejemplo n.º 4
0
def test_imagename_load_full() -> None:
    """Test loading a full ImageName."""
    with open(IMAGENAME_FULL) as fp:
        assert ImageName.load_from_file(fp) == ImageName("banana", "13.76")