source: git/modules/openmath/tests/xmlcoding.py @ 2acd2e

spielwiese
Last change on this file since 2acd2e was 2acd2e, checked in by Michael Brickenstein <bricken@…>, 18 years ago
*bricken: +testing git-svn-id: file:///usr/local/Singular/svn/trunk@9006 2c84dea3-7e68-4137-9b89-c4e89433aadc
  • Property mode set to 100644
File size: 716 bytes
Line 
1import unittest
2from objects import *
3from context import Context
4import lxmlencoder
5import lxmldecoder
6
7from cd.arith1 import implementation as arith1
8
9class OMTestCase1(unittest.TestCase):
10    def assertEncodeDecodeOK(self, expr):
11        orig=repr(expr)
12        new=repr(lxmldecoder.decode(lxmlencoder.encode(expr)))
13        self.assertEqual(new,orig)
14    def testOMI(self):
15        self.assertEncodeDecodeOK(1)
16        self.assertEncodeDecodeOK(1233593883529)
17    def testOMA(self):
18        self.assertEncodeDecodeOK(OMA(arith1.plus,[OMA(arith1.plus,[1,2]),3]))
19       
20               
21               
22if __name__=='__main__':
23    context=Context()
24    context.addCDImplementation(arith1)
25    unittest.main()
Note: See TracBrowser for help on using the repository browser.