コード例 #1
0
ファイル: component_test.py プロジェクト: pgleeson/nineml
    def test_backsub_all(self):

        # Check the aliases:
        # ====================== #
        c2 = ComponentClass(name='C1', aliases=['A:=1+2', 'B:=5*A', 'C:=B+2'])
        self.assertEqual(c2.aliases_map['A'].rhs_as_python_func()(), 3)

        # This should assert, because its not yet back-subbed
        c2.backsub_all()
        self.assertEqual(c2.aliases_map['B'].rhs_as_python_func()(), 15)
        # Check the ordering:
        self.assertEqual(c2.aliases_map['C'].rhs_as_python_func()(), ((5 * (3)) + 2))
        # ====================== #

        # Check the equations:
        # ====================== #
        warnings.warn('Tests not implemented')