summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2022-01-21 19:32:51 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2022-01-21 19:33:02 +0000
commitf18c637c042eec4678a79729a0e67da99017c465 (patch)
tree3080af2ff20756431ed8a71821febecbd1be3b2a /tests
parentReleasing debian version 2.2.0-1. (diff)
downloadcli-helpers-f18c637c042eec4678a79729a0e67da99017c465.tar.xz
cli-helpers-f18c637c042eec4678a79729a0e67da99017c465.zip
Merging upstream version 2.2.1.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'tests')
-rw-r--r--tests/tabular_output/test_output_formatter.py12
-rw-r--r--tests/tabular_output/test_preprocessors.py6
2 files changed, 13 insertions, 5 deletions
diff --git a/tests/tabular_output/test_output_formatter.py b/tests/tabular_output/test_output_formatter.py
index d064427..b307c1c 100644
--- a/tests/tabular_output/test_output_formatter.py
+++ b/tests/tabular_output/test_output_formatter.py
@@ -214,13 +214,21 @@ def test_enforce_iterable():
assert False, "{0} doesn't return iterable".format(format_name)
-def test_all_text_type():
+@pytest.mark.parametrize(
+ "extra_kwargs",
+ [
+ {},
+ {"style": "default"},
+ {"style": "colorful"},
+ ],
+)
+def test_all_text_type(extra_kwargs):
"""Test the TabularOutputFormatter class."""
data = [[1, "", None, Decimal(2)]]
headers = ["col1", "col2", "col3", "col4"]
output_formatter = TabularOutputFormatter()
for format_name in output_formatter.supported_formats:
for row in output_formatter.format_output(
- iter(data), headers, format_name=format_name
+ iter(data), headers, format_name=format_name, **extra_kwargs
):
assert isinstance(row, text_type), "not unicode for {}".format(format_name)
diff --git a/tests/tabular_output/test_preprocessors.py b/tests/tabular_output/test_preprocessors.py
index efc1b54..e428bfa 100644
--- a/tests/tabular_output/test_preprocessors.py
+++ b/tests/tabular_output/test_preprocessors.py
@@ -250,9 +250,9 @@ def test_style_output_custom_tokens():
data,
headers,
style=CliStyle,
- header_token="Token.Results.Headers",
- odd_row_token="Token.Results.OddRows",
- even_row_token="Token.Results.EvenRows",
+ header_token=Token.Results.Headers,
+ odd_row_token=Token.Results.OddRows,
+ even_row_token=Token.Results.EvenRows,
)
assert (expected_data, expected_headers) == (list(output[0]), output[1])