From 08d7566f0b756aae295e3d2f96cb8bf1b7a5dd7d Mon Sep 17 00:00:00 2001 From: "google-labs-jules[bot]" <161369871+google-labs-jules[bot]@users.noreply.github.com> Date: Mon, 15 Jun 2026 14:32:10 +0000 Subject: [PATCH 1/3] test: add tests for ModelObj.print_line() Adds missing unit tests for the `print_line()` method of `ModelObj` in `tests/test_structs.py`. The tests cover cases with no line label and no comment, line label only, comment only, and both line label and comment. Coverage for `bionetgen/modelapi/structs.py` improved as a result. Co-authored-by: akutuva21 <44119804+akutuva21@users.noreply.github.com> --- tests/test_structs.py | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) diff --git a/tests/test_structs.py b/tests/test_structs.py index b08d64ef..17754d81 100644 --- a/tests/test_structs.py +++ b/tests/test_structs.py @@ -41,3 +41,28 @@ def test_modelobj_line_label_setter(): # Test TypeError (setting a non-string/non-integer like a list) obj.line_label = [1, 2, 3] assert obj.line_label == "[1, 2, 3]: " + + +def test_modelobj_print_line(): + class DummyModelObj(ModelObj): + def gen_string(self) -> str: + return "dummy_object" + + obj = DummyModelObj() + + # Test base case with no line label and no comment + assert obj.print_line() == " dummy_object" + + # Test with line label only + obj.line_label = 1 + assert obj.print_line() == " 1 dummy_object" + + # Test with comment only + obj._line_label = None # reset line_label + obj.comment = "# test comment" + assert obj.print_line() == " dummy_object # test comment" + + # Test with both line label and comment + obj.line_label = 1 + obj.comment = "# test comment" + assert obj.print_line() == " 1 dummy_object # test comment" From 1ded24b388e55ccb1caca1e8340e71d4c9c8cacd Mon Sep 17 00:00:00 2001 From: "google-labs-jules[bot]" <161369871+google-labs-jules[bot]@users.noreply.github.com> Date: Mon, 15 Jun 2026 16:09:31 +0000 Subject: [PATCH 2/3] test: add tests for ModelObj.print_line() Adds missing unit tests for the `print_line()` method of `ModelObj` in `tests/test_structs.py`. The tests cover cases with no line label and no comment, line label only, comment only, and both line label and comment. Coverage for `bionetgen/modelapi/structs.py` improved as a result. Co-authored-by: akutuva21 <44119804+akutuva21@users.noreply.github.com> --- tests/test_structs.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/test_structs.py b/tests/test_structs.py index 17754d81..6b399ec9 100644 --- a/tests/test_structs.py +++ b/tests/test_structs.py @@ -58,7 +58,7 @@ def gen_string(self) -> str: assert obj.print_line() == " 1 dummy_object" # Test with comment only - obj._line_label = None # reset line_label + obj._line_label = None # reset line_label obj.comment = "# test comment" assert obj.print_line() == " dummy_object # test comment" From 94c1a51207637e3133c4f09e5e09b6b54bacd75e Mon Sep 17 00:00:00 2001 From: "google-labs-jules[bot]" <161369871+google-labs-jules[bot]@users.noreply.github.com> Date: Mon, 15 Jun 2026 16:21:49 +0000 Subject: [PATCH 3/3] test: add tests for ModelObj.print_line() Adds missing unit tests for the `print_line()` method of `ModelObj` in `tests/test_structs.py`. The tests cover cases with no line label and no comment, line label only, comment only, and both line label and comment. Coverage for `bionetgen/modelapi/structs.py` improved as a result. Co-authored-by: akutuva21 <44119804+akutuva21@users.noreply.github.com>