From: David F. <dav...@us...> - 2005-11-28 15:20:38
|
Update of /cvsroot/translate/src/translate/storage In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv6122 Modified Files: test_dtd.py Log Message: fixed simpleentity comment, added helper for regenerating source and test on simple string Index: test_dtd.py =================================================================== RCS file: /cvsroot/translate/src/translate/storage/test_dtd.py,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 --- test_dtd.py 28 Nov 2005 15:12:30 -0000 1.1 +++ test_dtd.py 28 Nov 2005 15:20:27 -0000 1.2 @@ -14,8 +14,12 @@ """helper that converts a dtd file back to source code""" return "".join(dtdfile.tolines()) + def dtdregen(self, dtdsource): + """helper that converts dtd source to dtdfile object and back""" + return self.dtdsource(self.dtdparse(dtdsource)) + def test_simpleentity(self): - """checks that a simple dtd entity definition converts properly to a po entry""" + """checks that a simple dtd entity definition is parsed correctly""" dtdsource = '<!ENTITY test.me "bananas for sale">\n' dtdfile = self.dtdparse(dtdsource) assert len(dtdfile.dtdelements) == 1 @@ -23,3 +27,9 @@ assert dtdelement.entity == "test.me" assert dtdelement.definition == '"bananas for sale"' + def test_simpleentity_source(self): + """checks that a simple dtd entity definition can be regenerated as source""" + dtdsource = '<!ENTITY test.me "bananas for sale">\n' + dtdregen = self.dtdregen(dtdsource) + assert dtdsource == dtdregen + |