Skip to content

Commit

Permalink
test: add compose_chart_export doctests
Browse files Browse the repository at this point in the history
  • Loading branch information
EspenAlbert committed Sep 27, 2023
1 parent b43e1e7 commit 0a95dce
Show file tree
Hide file tree
Showing 2 changed files with 29 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -70,10 +70,6 @@ def combine(old_path: Path, new_path: Path) -> None:
def ensure_no_update_lines_kept(
old_lines: list[str], new_lines: list[str], rel_path: str
) -> list[str]:
"""
>>> ensure_no_update_lines_kept(["{{- if .Values.deployment.enabled }} # noupdate", "line1", "line2", "{{- end }} # noupdate", "final line # noupdate"], ["newline1", "newline2"])
['{{- if .Values.deployment.enabled }} # noupdate', 'newline1', 'newline2', '{{- end }} # noupdate', 'final line # noupdate']
"""
extra_old_lines_start: list[str] = []
extra_old_lines_end: list[str] = []
at_start = True
Expand Down
29 changes: 29 additions & 0 deletions compose_chart_export/tests/test_chart_export/test_doctests.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
import pytest
import xdoctest as xdoc # type: ignore

from compose_chart_export import (
chart_combiner,
chart_file_templates,
chart_mods,
chart_read,
compose_export,
ports,
settings,
)


@pytest.mark.parametrize(
"module",
[
chart_combiner,
chart_mods,
chart_read,
ports,
chart_file_templates,
compose_export,
settings,
],
)
def test_chart_export_doctests(module):
return_code = xdoc.doctest_module(module.__file__, command="all", verbose=1)
assert not return_code["failed"]

0 comments on commit 0a95dce

Please sign in to comment.