mirror of
https://github.com/ansible-collections/community.docker.git
synced 2026-07-29 03:46:55 +00:00
docker_image_build: work around strange behavior of docker buildx build when --output is provided (#1006)
* Work around strange behavior of docker buildx build when --output is provided. * Adjust tests. * Allow to pass multiple image names; correctly quote --output values. * Return executed command. * Adjust tests.
This commit is contained in:
@@ -0,0 +1,21 @@
|
||||
# Copyright 2024 Felix Fontein <felix@fontein.de>
|
||||
# GNU General Public License v3.0+ (see LICENSES/GPL-3.0-or-later.txt or https://www.gnu.org/licenses/gpl-3.0.txt)
|
||||
# SPDX-License-Identifier: GPL-3.0-or-later
|
||||
|
||||
from __future__ import (absolute_import, division, print_function)
|
||||
__metaclass__ = type
|
||||
|
||||
import pytest
|
||||
|
||||
from ansible_collections.community.docker.plugins.modules.docker_image_build import _quote_csv
|
||||
|
||||
|
||||
@pytest.mark.parametrize("input, expected", [
|
||||
('', ''),
|
||||
(' ', '" "'),
|
||||
(',', '","'),
|
||||
('"', '""""'),
|
||||
('\rhello, "hi" !\n', '"\rhello, ""hi"" !\n"'),
|
||||
])
|
||||
def test__quote_csv(input, expected):
|
||||
assert _quote_csv(input) == expected
|
||||
Reference in New Issue
Block a user