@@ -231,7 +231,8 @@ def test_get_variables_for_task(self):
231
231
232
232
233
233
class ApplyModelChangesTestCase (unittest .TestCase ):
234
- FIXTURE_FILENAME = os .path .join (os .path .dirname (__file__ ), '../fixtures/sbml-list-of-species.xml' )
234
+ FIXTURE_FILENAME = os .path .join (os .path .dirname (__file__ ), '../fixtures/sbml-list-of-species-lvl-2.xml' )
235
+ FIXTURE_FILENAME_2 = os .path .join (os .path .dirname (__file__ ), '../fixtures/sbml-list-of-species-lvl-3.xml' )
235
236
236
237
def setUp (self ):
237
238
self .tmp_dir = tempfile .mkdtemp ()
@@ -668,7 +669,7 @@ def test_errors(self):
668
669
target = "/sbml:sbml/sbml:model/sbml:listOfSpecies/sbml:spesies[@id='Trim']/initialConcentration" ,
669
670
target_namespaces = {'sbml' : 'http://www.sbml.org/sbml/level2/version4' },
670
671
new_value = '1.9' )
671
- self ._attempt_change (change , self .FIXTURE_FILENAME , NotImplementedError )
672
+ self ._attempt_change (change , self .FIXTURE_FILENAME , ValueError )
672
673
673
674
change = data_model .ModelAttributeChange (
674
675
target = "/sbml:sbml/sbml:model/sbml:listOfSpecies/sbml:spesies[@id='Trim']" ,
@@ -746,6 +747,21 @@ def test_errors(self):
746
747
new_value = '1.9' )
747
748
self ._attempt_change (change , self .FIXTURE_FILENAME )
748
749
750
+ change = data_model .ModelAttributeChange (
751
+ target = "/sbml:sbml/sbml:model/sbml:listOfReactions/sbml:reaction[@id='lumen']/sbml:kineticLaw"
752
+ "/sbml:listOfParameters/sbml:parameter[@id='k1']" ,
753
+ target_namespaces = {'sbml' : 'http://www.sbml.org/sbml/level2/version4' },
754
+ new_value = '1.9' )
755
+ self ._attempt_change (change , self .FIXTURE_FILENAME )
756
+
757
+ change = data_model .ModelAttributeChange (
758
+ target = "/sbml:sbml/sbml:model/sbml:listOfReactions/sbml:reaction[@id='lumen']/sbml:kineticLaw"
759
+ "/sbml:listOfLocalParameters/sbml:localParameter[@id='k1']/@value" ,
760
+ target_namespaces = {'sbml' : 'http://www.sbml.org/sbml/level3/version1' },
761
+ new_value = '1.9' )
762
+ self ._attempt_change (change , self .FIXTURE_FILENAME_2 )
763
+
764
+
749
765
def _attempt_change (self , change : data_model .ModelChange , sbml_path : str ,
750
766
expected_exception : "type[BaseException] | tuple[type[BaseException], ...]" = None ):
751
767
et = etree .parse (sbml_path )
0 commit comments