From aed0ed633e7c1e8f87b455d2b87ec97eba65db60 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:33:22 +0000 Subject: [PATCH 1/3] Add unit tests for Action.print_line method Co-authored-by: akutuva21 <44119804+akutuva21@users.noreply.github.com> --- tests/test_structs.py | 21 ++++++++++++++++++++- 1 file changed, 20 insertions(+), 1 deletion(-) diff --git a/tests/test_structs.py b/tests/test_structs.py index b08d64ef..c74e1547 100644 --- a/tests/test_structs.py +++ b/tests/test_structs.py @@ -1,5 +1,5 @@ import pytest -from bionetgen.modelapi.structs import ModelObj +from bionetgen.modelapi.structs import ModelObj, Action def test_modelobj_setitem(): @@ -41,3 +41,22 @@ 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_action_print_line(): + action = Action("simulate", {"method": "ode", "t_end": 100, "n_steps": 100}) + # Test base print_line + assert action.print_line() == "simulate({method=>ode,t_end=>100,n_steps=>100})" + + # Test with line_label + action.line_label = 1 + assert action.print_line() == "1 simulate({method=>ode,t_end=>100,n_steps=>100})" + + # Test with comment + action = Action("simulate", {"method": "ode", "t_end": 100, "n_steps": 100}) + action.comment = "This is a comment" + assert action.print_line() == "simulate({method=>ode,t_end=>100,n_steps=>100}) #This is a comment" + + # Test with line_label and comment + action.line_label = 1 + assert action.print_line() == "1 simulate({method=>ode,t_end=>100,n_steps=>100}) #This is a comment" From 6c14971d68ac9615bae59c73e3ed9efe73ce32b2 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:25:47 +0000 Subject: [PATCH 2/3] Add unit tests for Action.print_line method Co-authored-by: akutuva21 <44119804+akutuva21@users.noreply.github.com> --- tests/test_structs.py | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/tests/test_structs.py b/tests/test_structs.py index c74e1547..04d15879 100644 --- a/tests/test_structs.py +++ b/tests/test_structs.py @@ -55,8 +55,14 @@ def test_action_print_line(): # Test with comment action = Action("simulate", {"method": "ode", "t_end": 100, "n_steps": 100}) action.comment = "This is a comment" - assert action.print_line() == "simulate({method=>ode,t_end=>100,n_steps=>100}) #This is a comment" + assert ( + action.print_line() + == "simulate({method=>ode,t_end=>100,n_steps=>100}) #This is a comment" + ) # Test with line_label and comment action.line_label = 1 - assert action.print_line() == "1 simulate({method=>ode,t_end=>100,n_steps=>100}) #This is a comment" + assert ( + action.print_line() + == "1 simulate({method=>ode,t_end=>100,n_steps=>100}) #This is a comment" + ) From 75dd4dc6db1d908257ea42c5895ae9a72ad4e43b 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:53:38 +0000 Subject: [PATCH 3/3] Add unit tests for Action.print_line method Co-authored-by: akutuva21 <44119804+akutuva21@users.noreply.github.com>