import unittest
import os

import scipy

from SloppyCell.ReactionNetworks import *

from AlgTestNets import algebraic_net_assignment
base_net = algebraic_net_assignment.copy()

class test_Misc(unittest.TestCase):
    def test_AssignedVarBug(self):
        """ Test handling of assigned variables initialized to concentration 
        'None'"""
        net = base_net.copy('test')
        net.add_species('tester', 'cell', None)
        net.add_assignment_rule('tester', 'X0')
        net.updateAssignedVars(1.0)

suite = unittest.makeSuite(test_Misc)
if __name__ == '__main__':
    unittest.main()

@@ -337,16 +337,59 @@
 one'%22%22%22%0A
+        # This used to raise an exception.%0A
         
@@ -549,16 +549,751 @@
 s(1.0)%0A%0A
+    def test_ChangingFunctionDefs(self):%0A        %22%22%22%0A        Test whether changing function definitions are handled correctly.%0A        %22%22%22%0A        net = Network('test')%0A        net.add_parameter('x', 0.0)%0A        net.add_rate_rule('x', 'f(1)')%0A        net.add_func_def('f', %5B'x'%5D, 'x+2')%0A        traj = Dynamics.integrate(net, %5B0, 10%5D)%0A        self.assertAlmostEqual(traj.get_var_val('x', 10), 30)%0A        # It's not clear to me why this version wasn't causing failures%0A        # before...%0A        #net.remove_component('f')%0A        #net.add_func_def('f', %5B'x'%5D, 'x+4')%0A        net.functionDefinitions.get('f').math = 'x+4'%0A        traj = Dynamics.integrate(net, %5B0, 10%5D)%0A        self.assertAlmostEqual(traj.get_var_val('x', 10), 50)%0A%0A
 suite = 

Add test for bug involving function definitions that Jordan found.