File tree Expand file tree Collapse file tree 2 files changed +32
-0
lines changed Expand file tree Collapse file tree 2 files changed +32
-0
lines changed Original file line number Diff line number Diff line change 180180 rates = Dict (zip (parameters (rn4), k))
181181 @test Catalyst. iscomplexbalanced (rn4, rates) == true
182182end
183+
184+ let
185+ rn = @reaction_network begin
186+ (k1, k2), C1 <--> C2
187+ (k3, k4), C2 <--> C3
188+ (k5, k6), C3 <--> C1
189+ end
190+
191+ incorrect_params = Dict (:k1 => 0.5 )
192+ @test_throws ErrorException Catalyst. iscomplexbalanced (rn, incorrect_params)
193+ end
183194
184195# ## Tests Reversibility ###
185196
708719 Catalyst. ratematrix (rn, rates_vec) == rate_mat
709720 Catalyst. ratematrix (rn, rates_tup) == rate_mat
710721 Catalyst. ratematrix (rn, rates_dict) == rate_mat
722+
723+ # Tests that throws error in rate matrix.
724+ incorrect_param_dict = Dict (:k1 => 1.0 )
725+
726+ @test_throws ErrorException Catalyst. ratematrix (rn, 123 )
727+ @test_throws ErrorException Catalyst. ratematrix (rn, incorrect_param_dict)
728+
711729 @test_throws Exception Catalyst. iscomplexbalanced (rn, rates_invalid)
712730end
713731
739757 @test Catalyst. robustspecies (EnvZ_OmpR) == [6 ]
740758end
741759
760+ let
761+ # Define a reaction network with bi-directional reactions
762+ non_deficient_network = @reaction_network begin
763+ (k1, k2), A <--> B
764+ (k3, k4), B <--> C
765+ end
766+
767+ # Test: Check that the error is raised for networks with deficiency != 1
768+ @test_throws ErrorException Catalyst. robustspecies (non_deficient_network)
769+ end
770+
742771
743772# ## Complex and detailed balance tests
744773
Original file line number Diff line number Diff line change 107107let
108108 @named rs2 = ReactionSystem (rxs, t)
109109 @test Catalyst. isequivalent (rs, rs2)
110+
111+ # Test with a type mismatch
112+ @test Catalyst. isequivalent (rs, " Not a ReactionSystem" ) == false
110113end
111114
112115# Defaults test.
You can’t perform that action at this time.
0 commit comments