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 | |
---|
1 | import unittest |
---|
2 | from objects import * |
---|
3 | from context import Context |
---|
4 | import lxmlencoder |
---|
5 | import lxmldecoder |
---|
6 | |
---|
7 | from cd.arith1 import implementation as arith1 |
---|
8 | |
---|
9 | class 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 | |
---|
22 | if __name__=='__main__': |
---|
23 | context=Context() |
---|
24 | context.addCDImplementation(arith1) |
---|
25 | unittest.main() |
---|
Note: See
TracBrowser
for help on using the repository browser.