Debian Codegraph @

ansible_collections/community/docker/tests/unit/plugins/modules/test_docker_image_build.py

raw
1 # Copyright 2024 Felix Fontein <[email protected]>
2 # GNU General Public License v3.0+ (see LICENSES/GPL-3.0-or-later.txt or https://www.gnu.org/licenses/gpl-3.0.txt)
3 # SPDX-License-Identifier: GPL-3.0-or-later
4
5 from __future__ import annotations
6
7 import pytest
8
9 from ansible_collections.community.docker.plugins.modules.docker_image_build import (
10 _quote_csv,
11 )
12
13
14 @pytest.mark.parametrize(
15 "value, expected",
16 [
17 ("", ""),
18 (" ", '" "'),
19 (",", '","'),
20 ('"', '""""'),
21 ('\rhello, "hi" !\n', '"\rhello, ""hi"" !\n"'),
22 ],
23 )
24 def test__quote_csv(value: str, expected: str) -> None:
25 assert _quote_csv(value) == expected