Beispiel #1
0
 def test_009_literal(self):
     cmd = (
         'python generateDS.py --no-dates --no-versions -f '
         '-o tests/out2_sup.py -s tests/out2_sub.py '
         '--export="write literal" '
         '--super=out2_sup -u gends_user_methods tests/people.xsd'
     )
     self.executeClean(cmd, cwd='..')
     import out2_sup
     save_stdout = sys.stdout
     sys.stdout = open('literal2.py', 'w')
     out2_sup.parseLiteral('people.xml')
     sys.stdout.close()
     sys.stdout = save_stdout
     infile = open('literal1.py', 'r')
     content1 = infile.read()
     infile.close()
     infile = open('literal2.py', 'r')
     content2 = infile.read()
     infile.close()
     self.failUnlessEqual(content1, content2)
     # cleanup generated files
     self.remove('literal2.py')
     self.remove('out2_sup.py')
     self.remove('out2_sub.py')
Beispiel #2
0
 def test_009_literal(self):
     import out2_sup
     save_stdout = sys.stdout
     sys.stdout = open('literal2.py', 'w')
     out2_sup.parseLiteral('people.xml')
     sys.stdout.close()
     sys.stdout = save_stdout
     infile = open('literal1.py', 'r')
     content1 = infile.read()
     infile.close()
     infile = open('literal2.py', 'r')
     content2 = infile.read()
     infile.close()
     self.failUnlessEqual(content1, content2)
Beispiel #3
0
 def test_009_literal(self):
     import out2_sup
     save_stdout = sys.stdout
     sys.stdout = open('literal2.py', 'w')
     out2_sup.parseLiteral('people.xml')
     sys.stdout.close()
     sys.stdout = save_stdout
     infile = open('literal1.py', 'r')
     content1 = infile.read()
     infile.close()
     infile = open('literal2.py', 'r')
     content2 = infile.read()
     infile.close()
     self.failUnlessEqual(content1, content2)