mirror of
https://github.com/cookiecutter/cookiecutter-django.git
synced 2025-08-15 09:24:52 +03:00
Remove unused append_linesep parameter
This commit is contained in:
parent
f70a2fe05a
commit
4cf5544e75
|
@ -14,12 +14,10 @@ DOTENV_FILE = BASE_DIR / ".env"
|
|||
def merge(
|
||||
output_file: Path,
|
||||
files_to_merge: Sequence[Path],
|
||||
append_linesep: bool = True,
|
||||
) -> None:
|
||||
merged_content = ""
|
||||
for merge_file in files_to_merge:
|
||||
merged_content += merge_file.read_text()
|
||||
if append_linesep:
|
||||
merged_content += os.linesep
|
||||
output_file.write_text(merged_content)
|
||||
|
||||
|
|
|
@ -6,28 +6,19 @@ from merge_production_dotenvs_in_dotenv import merge
|
|||
|
||||
|
||||
@pytest.mark.parametrize(
|
||||
("input_contents", "append_linesep", "expected_output"),
|
||||
("input_contents", "expected_output"),
|
||||
[
|
||||
# No line separator
|
||||
([], False, ""),
|
||||
([""], False, ""),
|
||||
(["\n"], False, "\n"),
|
||||
(["TEST=1"], False, "TEST=1"),
|
||||
(["THIS=2", "THAT='example'"], False, "THIS=2THAT='example'"),
|
||||
(["ONE=1\n", "TWO=2"], False, "ONE=1\nTWO=2"),
|
||||
(["A=0", "B=1", "C=2"], False, "A=0B=1C=2"),
|
||||
# With line separator
|
||||
([], True, ""),
|
||||
([""], True, "\n"),
|
||||
(["JANE=doe"], True, "JANE=doe\n"),
|
||||
(["SEP=true", "AR=ator"], True, "SEP=true\nAR=ator\n"),
|
||||
(["X=x\n", "Y=y", "Z=z\n"], True, "X=x\n\nY=y\nZ=z\n\n"),
|
||||
([], ""),
|
||||
([""], "\n"),
|
||||
(["JANE=doe"], "JANE=doe\n"),
|
||||
(["SEP=true", "AR=ator"], "SEP=true\nAR=ator\n"),
|
||||
(["A=0", "B=1", "C=2"], "A=0\nB=1\nC=2\n"),
|
||||
(["X=x\n", "Y=y", "Z=z\n"], "X=x\n\nY=y\nZ=z\n\n"),
|
||||
],
|
||||
)
|
||||
def test_merge(
|
||||
tmp_path: Path,
|
||||
input_contents: list[str],
|
||||
append_linesep: bool,
|
||||
expected_output: str,
|
||||
):
|
||||
output_file = tmp_path / ".env"
|
||||
|
@ -38,6 +29,6 @@ def test_merge(
|
|||
merge_file.write_text(input_content)
|
||||
files_to_merge.append(merge_file)
|
||||
|
||||
merge(output_file, files_to_merge, append_linesep)
|
||||
merge(output_file, files_to_merge)
|
||||
|
||||
assert output_file.read_text() == expected_output
|
||||
|
|
Loading…
Reference in New Issue
Block a user