From e132a7332acf3e0ed96202a6d84d56911679cdac Mon Sep 17 00:00:00 2001 From: Anwesha-codes-10 Date: Thu, 25 Jun 2026 14:44:06 +0530 Subject: [PATCH 1/3] et-ExecutionPolicy -Scope Process -ExecutionPolicy RemoteSigned) ; (& c:\Users\anwes\Downloads\stargraph\.venv\Scripts\Activate.ps1) Signed-off-by: Anwesha-codes-10 --- tests/unit/cli/test_summary.py | 74 ++++++++++++++++++++++++++++++++++ 1 file changed, 74 insertions(+) create mode 100644 tests/unit/cli/test_summary.py diff --git a/tests/unit/cli/test_summary.py b/tests/unit/cli/test_summary.py new file mode 100644 index 0000000..96b7f86 --- /dev/null +++ b/tests/unit/cli/test_summary.py @@ -0,0 +1,74 @@ +# SPDX-License-Identifier: Apache-2.0 + +import pytest + +from stargraph.cli._summary import ( + _fmt_duration, + _is_artifact_field, + _is_default, +) # pyright: ignore[reportPrivateUsage] + +@pytest.mark.unit +@pytest.mark.parametrize( + ("milliseconds", "expected"), + [ + (500, "500ms"), + (1000, "1.0s"), + (1500, "1.5s"), + ], +) +def test_fmt_duration(milliseconds: int, expected: str) -> None: + assert _fmt_duration(milliseconds) == expected + + +@pytest.mark.unit +@pytest.mark.parametrize( + "value", + [ + None, + "", + [], + {}, + 0, + False, + ], +) +def test_is_default_returns_true(value) -> None: + assert _is_default(value) is True + + +@pytest.mark.unit +@pytest.mark.parametrize( + "value", + [ + "x", + 5, + [1], + ], +) +def test_is_default_returns_false(value) -> None: + assert _is_default(value) is False + + +@pytest.mark.unit +def test_is_artifact_field_true() -> None: + assert ( + _is_artifact_field( + "out_files", + {"a.txt": "hello"}, + ) + is True + ) + + +@pytest.mark.unit +@pytest.mark.parametrize( + ("name", "value"), + [ + ("output", {"a.txt": "hello"}), + ("out_files", []), + ("out_files", {"a.txt": 5}), + ], +) +def test_is_artifact_field_false(name, value) -> None: + assert _is_artifact_field(name, value) is False From e1a452575d4aae64aef03c6cae6a792889aabf36 Mon Sep 17 00:00:00 2001 From: "autofix-ci[bot]" <114827586+autofix-ci[bot]@users.noreply.github.com> Date: Thu, 25 Jun 2026 15:26:14 +0000 Subject: [PATCH 2/3] [autofix.ci] apply automated fixes --- tests/unit/cli/test_summary.py | 1 + 1 file changed, 1 insertion(+) diff --git a/tests/unit/cli/test_summary.py b/tests/unit/cli/test_summary.py index 96b7f86..95e244d 100644 --- a/tests/unit/cli/test_summary.py +++ b/tests/unit/cli/test_summary.py @@ -8,6 +8,7 @@ _is_default, ) # pyright: ignore[reportPrivateUsage] + @pytest.mark.unit @pytest.mark.parametrize( ("milliseconds", "expected"), From d5073870664600abdb3081ced35c655f080eaed0 Mon Sep 17 00:00:00 2001 From: Anwesha-codes-10 Date: Thu, 25 Jun 2026 14:44:06 +0530 Subject: [PATCH 3/3] et-ExecutionPolicy -Scope Process -ExecutionPolicy RemoteSigned) ; (& c:\Users\anwes\Downloads\stargraph\.venv\Scripts\Activate.ps1) Signed-off-by: Anwesha-codes-10 --- tests/unit/cli/test_summary.py | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/tests/unit/cli/test_summary.py b/tests/unit/cli/test_summary.py index 95e244d..d2baae7 100644 --- a/tests/unit/cli/test_summary.py +++ b/tests/unit/cli/test_summary.py @@ -2,12 +2,20 @@ import pytest +<<<<<<< HEAD from stargraph.cli._summary import ( _fmt_duration, _is_artifact_field, _is_default, ) # pyright: ignore[reportPrivateUsage] +======= +from stargraph.cli._summary import ( # pyright: ignore[reportPrivateUsage] + _fmt_duration, + _is_artifact_field, + _is_default, +) +>>>>>>> 834217e (et-ExecutionPolicy -Scope Process -ExecutionPolicy RemoteSigned) ; (&) @pytest.mark.unit @pytest.mark.parametrize( @@ -34,7 +42,11 @@ def test_fmt_duration(milliseconds: int, expected: str) -> None: False, ], ) +<<<<<<< HEAD def test_is_default_returns_true(value) -> None: +======= +def test_is_default_returns_true(value: object) -> None: +>>>>>>> 834217e (et-ExecutionPolicy -Scope Process -ExecutionPolicy RemoteSigned) ; (&) assert _is_default(value) is True @@ -47,7 +59,11 @@ def test_is_default_returns_true(value) -> None: [1], ], ) +<<<<<<< HEAD def test_is_default_returns_false(value) -> None: +======= +def test_is_default_returns_false(value: object) -> None: +>>>>>>> 834217e (et-ExecutionPolicy -Scope Process -ExecutionPolicy RemoteSigned) ; (&) assert _is_default(value) is False @@ -71,5 +87,9 @@ def test_is_artifact_field_true() -> None: ("out_files", {"a.txt": 5}), ], ) +<<<<<<< HEAD def test_is_artifact_field_false(name, value) -> None: +======= +def test_is_artifact_field_false(name: str, value: object) -> None: +>>>>>>> 834217e (et-ExecutionPolicy -Scope Process -ExecutionPolicy RemoteSigned) ; (&) assert _is_artifact_field(name, value) is False