community.docker/tests/unit/plugins/modules/test_docker_image_build.py
Felix Fontein 6ad4bfcd40
Add typing information, 2/n (#1178)
* Add typing to Docker Stack modules. Clean modules up.

* Add typing to Docker Swarm modules.

* Add typing to unit tests.

* Add more typing.

* Add ignore.txt entries.
2025-10-25 01:16:04 +02:00

26 lines
669 B
Python

# 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 annotations
import pytest
from ansible_collections.community.docker.plugins.modules.docker_image_build import (
_quote_csv,
)
@pytest.mark.parametrize(
"value, expected",
[
("", ""),
(" ", '" "'),
(",", '","'),
('"', '""""'),
('\rhello, "hi" !\n', '"\rhello, ""hi"" !\n"'),
],
)
def test__quote_csv(value: str, expected: str) -> None:
assert _quote_csv(value) == expected