Example #1
0
def test_image_tag(image):
    name = fake_name()
    wanted = "localhost/" + name + ":latest"
    image.tag(name)
    actual = _buildah.inspect(name)
    assert actual["FromImage"] == image.name
    _buildah.rmi(wanted)
Example #2
0
def test_tag(image):
    name = fake_name()
    wanted = f"localhost/{name}:latest"
    _buildah.tag(image.id, name)
    actual = _buildah.inspect(name)
    assert actual["FromImage"] == image.name
    _buildah.rmi(wanted)
Example #3
0
def test_container_commit(container):
    name = "".join(faker.random_letters()).lower()
    image = container.commit(name)
    actual = _buildah.inspect(image.id)
    assert actual["FromImage"] == "localhost/{}:latest".format(name)
    image.rm()
Example #4
0
def test_rm():
    container = _buildah.from_("alpine:3.12", name=fake_name())
    _buildah.inspect(container.id)
    _buildah.rm(container.id)
    with _pytest.raises(_buildah.BuildahNotFound):
        _buildah.inspect(container.id)
Example #5
0
def test_inspect_image():
    c = _buildah.images()[0]
    actual = _buildah.inspect(c.id, type="image")
    assert "Type" in actual
Example #6
0
def test_inspect_container(container):
    actual = _buildah.inspect(container.id, type="container")
    assert "Type" in actual