Changeset 1218
- Timestamp:
- Jan 26, 2013, 5:42:20 PM (11 years ago)
- Location:
- branches/stable/0.7.x
- Files:
-
- 2 edited
-
. (modified) (1 prop)
-
genshi/template/tests/text.py (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
branches/stable/0.7.x
-
branches/stable/0.7.x/genshi/template/tests/text.py
r1088 r1218 95 95 96 96 def test_include(self): 97 file1 = open(os.path.join(self.dirname, 'tmpl1.txt'), 'w ')98 try: 99 file1.write( "Included\n")97 file1 = open(os.path.join(self.dirname, 'tmpl1.txt'), 'wb') 98 try: 99 file1.write(u"Included\n".encode("utf-8")) 100 100 finally: 101 101 file1.close() 102 102 103 file2 = open(os.path.join(self.dirname, 'tmpl2.txt'), 'w ')104 try: 105 file2.write( """----- Included data below this line -----103 file2 = open(os.path.join(self.dirname, 'tmpl2.txt'), 'wb') 104 try: 105 file2.write(u"""----- Included data below this line ----- 106 106 #include tmpl1.txt 107 ----- Included data above this line -----""" )107 ----- Included data above this line -----""".encode("utf-8")) 108 108 finally: 109 109 file2.close() … … 220 220 221 221 def test_include(self): 222 file1 = open(os.path.join(self.dirname, 'tmpl1.txt'), 'w ')223 try: 224 file1.write( "Included")222 file1 = open(os.path.join(self.dirname, 'tmpl1.txt'), 'wb') 223 try: 224 file1.write(u"Included".encode("utf-8")) 225 225 finally: 226 226 file1.close() 227 227 228 file2 = open(os.path.join(self.dirname, 'tmpl2.txt'), 'w ')229 try: 230 file2.write( """----- Included data below this line -----228 file2 = open(os.path.join(self.dirname, 'tmpl2.txt'), 'wb') 229 try: 230 file2.write(u"""----- Included data below this line ----- 231 231 {% include tmpl1.txt %} 232 ----- Included data above this line -----""" )232 ----- Included data above this line -----""".encode("utf-8")) 233 233 finally: 234 234 file2.close() … … 242 242 243 243 def test_include_expr(self): 244 file1 = open(os.path.join(self.dirname, 'tmpl1.txt'), 'w ')244 file1 = open(os.path.join(self.dirname, 'tmpl1.txt'), 'wb') 245 245 try: 246 file1.write( "Included")246 file1.write(u"Included".encode("utf-8")) 247 247 finally: 248 248 file1.close() 249 249 250 file2 = open(os.path.join(self.dirname, 'tmpl2.txt'), 'w ')250 file2 = open(os.path.join(self.dirname, 'tmpl2.txt'), 'wb') 251 251 try: 252 file2.write( """----- Included data below this line -----252 file2.write(u"""----- Included data below this line ----- 253 253 {% include ${'%s.txt' % ('tmpl1',)} %} 254 ----- Included data above this line -----""" )254 ----- Included data above this line -----""".encode("utf-8")) 255 255 finally: 256 256 file2.close()
Note: See TracChangeset
for help on using the changeset viewer.
