From ba289ccf230d4ae5d6c292b83a13ad6033bba77d Mon Sep 17 00:00:00 2001 From: Felipe Peter Date: Thu, 14 Dec 2023 10:48:56 +0800 Subject: [PATCH] test: Use non-heavy header border for Windows compatibility --- src/voraus_template_updater/_schemas.py | 5 +++-- tests/resources/example_summary_output.txt | 12 ++++++------ tests/unit/test_schemas.py | 2 +- 3 files changed, 10 insertions(+), 9 deletions(-) diff --git a/src/voraus_template_updater/_schemas.py b/src/voraus_template_updater/_schemas.py index b7d570b..1597d8b 100644 --- a/src/voraus_template_updater/_schemas.py +++ b/src/voraus_template_updater/_schemas.py @@ -6,6 +6,7 @@ from github.PullRequest import PullRequest from pydantic import BaseModel, ConfigDict +from rich import box from rich.console import Console from rich.table import Table from rich.text import Text @@ -71,7 +72,7 @@ def print(self) -> None: def _print_table_of_projects(projects: List[Project]) -> None: title = _get_table_title(projects) - table = Table(title=title) + table = Table(title=title, box=box.SQUARE) table.add_column("Maintainer") table.add_column("Projects") @@ -150,7 +151,7 @@ def _get_projects_by_maintainer(projects: List[Project]) -> Dict[Optional[str], def _print_table_of_skipped_projects(projects: List[SkippedProject]) -> None: - table = Table(title=f"Skipped projects: {len(projects)}") + table = Table(title=f"Skipped projects: {len(projects)}", box=box.SQUARE) table.add_column("Project") table.add_column("URL") table.add_column("Skip reason") diff --git a/tests/resources/example_summary_output.txt b/tests/resources/example_summary_output.txt index 0c5c8a5..a54ba11 100644 --- a/tests/resources/example_summary_output.txt +++ b/tests/resources/example_summary_output.txt @@ -1,7 +1,7 @@ Projects: 7 Outdated: 4 Up to date: 3 -┏━━━━━━━━━━━━━━┳━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┓ -┃ Maintainer ┃ Projects ┃ -┡━━━━━━━━━━━━━━╇━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┩ +┌──────────────┬────────────────────────────────────────────────────────┐ +│ Maintainer │ Projects │ +├──────────────┼────────────────────────────────────────────────────────┤ │ maintainer-1 │ Project: project-1 │ │ │ URL: https://project1.com │ │ │ Status: Up to date │ @@ -63,9 +63,9 @@ Skipped projects: 3 -┏━━━━━━━━━━━━┳━━━━━━━━━━━━━━━━━━━━━━━┳━━━━━━━━━━━━━━━━━━┓ -┃ Project ┃ URL ┃ Skip reason ┃ -┡━━━━━━━━━━━━╇━━━━━━━━━━━━━━━━━━━━━━━╇━━━━━━━━━━━━━━━━━━┩ +┌────────────┬───────────────────────┬──────────────────┐ +│ Project │ URL │ Skip reason │ +├────────────┼───────────────────────┼──────────────────┤ │ project-9 │ https://project9.com │ No .cruft.json │ │ project-11 │ https://project11.com │ No .cruft.json │ │ project-10 │ https://project10.com │ Project archived │ diff --git a/tests/unit/test_schemas.py b/tests/unit/test_schemas.py index c44408c..2c9525e 100644 --- a/tests/unit/test_schemas.py +++ b/tests/unit/test_schemas.py @@ -18,4 +18,4 @@ def test_summary_printing(datetime_mock: MagicMock, capsys: CaptureFixture, reso summary.print() stdout = capsys.readouterr().out - assert stdout == (resource_dir / "example_summary_output.txt").read_text() + assert stdout == (resource_dir / "example_summary_output.txt").read_text(encoding="utf-8")