mirror of
https://github.com/ansible-collections/community.general.git
synced 2026-04-25 05:02:46 +00:00
Reformat everything.
This commit is contained in:
parent
3f2213791a
commit
340ff8586d
1008 changed files with 61301 additions and 58309 deletions
|
|
@ -8,13 +8,12 @@ from __future__ import annotations
|
|||
from ansible_collections.community.general.plugins.modules import ini_file
|
||||
|
||||
|
||||
def do_test(option, ignore_spaces, newline, before, expected_after,
|
||||
expected_changed, expected_msg):
|
||||
def do_test(option, ignore_spaces, newline, before, expected_after, expected_changed, expected_msg):
|
||||
section_lines = [before]
|
||||
changed_lines = [0]
|
||||
changed, msg = ini_file.update_section_line(
|
||||
option, None, section_lines, 0, changed_lines, ignore_spaces,
|
||||
newline, None)
|
||||
option, None, section_lines, 0, changed_lines, ignore_spaces, newline, None
|
||||
)
|
||||
assert section_lines[0] == expected_after
|
||||
assert changed == expected_changed
|
||||
assert changed_lines[0] == 1
|
||||
|
|
@ -22,29 +21,29 @@ def do_test(option, ignore_spaces, newline, before, expected_after,
|
|||
|
||||
|
||||
def test_ignore_spaces_comment():
|
||||
oldline = ';foobar=baz'
|
||||
newline = 'foobar = baz'
|
||||
do_test('foobar', True, newline, oldline, newline, True, 'option changed')
|
||||
oldline = ";foobar=baz"
|
||||
newline = "foobar = baz"
|
||||
do_test("foobar", True, newline, oldline, newline, True, "option changed")
|
||||
|
||||
|
||||
def test_ignore_spaces_changed():
|
||||
oldline = 'foobar=baz'
|
||||
newline = 'foobar = freeble'
|
||||
do_test('foobar', True, newline, oldline, newline, True, 'option changed')
|
||||
oldline = "foobar=baz"
|
||||
newline = "foobar = freeble"
|
||||
do_test("foobar", True, newline, oldline, newline, True, "option changed")
|
||||
|
||||
|
||||
def test_ignore_spaces_unchanged():
|
||||
oldline = 'foobar=baz'
|
||||
newline = 'foobar = baz'
|
||||
do_test('foobar', True, newline, oldline, oldline, False, None)
|
||||
oldline = "foobar=baz"
|
||||
newline = "foobar = baz"
|
||||
do_test("foobar", True, newline, oldline, oldline, False, None)
|
||||
|
||||
|
||||
def test_no_ignore_spaces_changed():
|
||||
oldline = 'foobar=baz'
|
||||
newline = 'foobar = baz'
|
||||
do_test('foobar', False, newline, oldline, newline, True, 'option changed')
|
||||
oldline = "foobar=baz"
|
||||
newline = "foobar = baz"
|
||||
do_test("foobar", False, newline, oldline, newline, True, "option changed")
|
||||
|
||||
|
||||
def test_no_ignore_spaces_unchanged():
|
||||
newline = 'foobar=baz'
|
||||
do_test('foobar', False, newline, newline, newline, False, None)
|
||||
newline = "foobar=baz"
|
||||
do_test("foobar", False, newline, newline, newline, False, None)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue